2012-01-16 16:42:50 -- -- Table structure for table `routes` -- CREATE TABLE IF NOT EXISTS `routes` ( `route_id` int(11) NOT NULL AUTO_INCREMENT, `type` int(11) NOT NULL, PRIMARY KEY (`route_id`) ) -- -- Table structure for table `geopoints` -- CREATE TABLE IF NOT EXISTS `geopoints` ( `geopoint_id` int(11) NOT NULL AUTO_INCREMENT, `route_id` int(11) NOT NULL, `latitude` float NOT NULL, `longitude` float NOT NULL, `altitude` float NOT NULL, `timestamp` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`geopoint_id`), KEY `route_id` (`route_id`) ) -- -- Constraints for table `geopoints` -- ALTER TABLE `geopoints` ADD CONSTRAINT `geopoints_ibfk_1` FOREIGN KEY (`route_id`) REFERENCES `routes` (`route_id`) ON DELETE CASCADE ON UPDATE CASCADE;