Home | History | Annotate | Download | only in migrations
      1 UP_SQL = """
      2 ALTER TABLE `planner_tests` RENAME TO `planner_test_configs`;
      3 
      4 ALTER TABLE `planner_test_jobs` DROP FOREIGN KEY `test_jobs_test_id_fk`;
      5 ALTER TABLE `planner_test_jobs` DROP KEY `planner_test_jobs_test_id`;
      6 
      7 ALTER TABLE `planner_test_jobs` CHANGE COLUMN
      8 `test_id` `test_config_id` INT NOT NULL;
      9 
     10 ALTER TABLE `planner_test_jobs` ADD CONSTRAINT `test_jobs_test_config_id_fk`
     11 FOREIGN KEY `planner_test_jobs_test_config_id`
     12 (`test_config_id`) REFERENCES `planner_test_configs` (`id`);
     13 """
     14 
     15 DOWN_SQL = """
     16 ALTER TABLE `planner_test_configs` RENAME TO `planner_tests`;
     17 
     18 ALTER TABLE `planner_test_jobs` DROP FOREIGN KEY `test_jobs_test_config_id_fk`;
     19 ALTER TABLE `planner_test_jobs` DROP KEY `planner_test_jobs_test_config_id`;
     20 
     21 ALTER TABLE `planner_test_jobs` CHANGE COLUMN
     22 `test_config_id` `test_id` INT NOT NULL;
     23 
     24 ALTER TABLE `planner_test_jobs` ADD CONSTRAINT `test_jobs_test_id_fk`
     25 FOREIGN KEY `planner_test_jobs_test_id`
     26 (`test_id`) REFERENCES `planner_tests` (`id`);
     27 """
     28