claudysta Posted November 15, 2010 Report Share Posted November 15, 2010 (edited) Me vi en la obligación, la semana pasada, de crear un script mysql para cargar las estaciones del metro, aquí van las tablas (estan incluidas las estaciones del metro a maipú, que pronto se supone qe van a funcionar) CÓDIGO --02 -- Estructura de tabla para la tabla `metro_linea`03 --04 05 CREATE TABLE IF NOT EXISTS `metro_linea` (06 `metro_linea_id` bigint(20) NOT NULL auto_increment,07 `nombre` varchar(255) collate utf8_spanish_ci NOT NULL,08 PRIMARY KEY (`metro_linea_id`)09 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;10 11 -- --------------------------------------------------------------12 13 --14 -- Estructura de tabla para la tabla `metro_estacion`15 --16 17 CREATE TABLE IF NOT EXISTS `metro_estacion` (18 `metro_estacion_id` bigint(20) NOT NULL auto_increment,19 `metro_linea_id` bigint(20) NOT NULL,20 `nombre` varchar(255) collate utf8_spanish_ci NOT NULL,21 PRIMARY KEY (`metro_estacion_id`),22 KEY `fk_metro_linea_id` (`metro_linea_id`)23 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;24 25 --26 -- Filtros para la tabla `metro_estacion`27 --28 ALTER TABLE `metro_estacion`29 ADD CONSTRAINT `fk_metro_estacion_metro_linea` FOREIGN KEY (`metro_linea_id`) REFERENCES `metro_linea` (`metro_linea_id`) ON DELETE NO ACTION ON UPDATE NO ACTION; dentro del zip se encuentran los datos de la carga, ojala les sirvan --Edit : el archivo estaba en MU, luego pongo la carga de estaciones :) Edited February 3, 2012 by claudysta Link to comment Share on other sites More sharing options...
tapiarodrigo Posted November 24, 2010 Report Share Posted November 24, 2010 Se agradece que quisieras compartir tu script. Link to comment Share on other sites More sharing options...
jonasnot Posted October 22, 2011 Report Share Posted October 22, 2011 buen aporte.. Link to comment Share on other sites More sharing options...
zenit_and Posted November 9, 2011 Report Share Posted November 9, 2011 excelente. gracias! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now