1 def migrate_up(manager): 2 manager.execute_script(CREATE_TABLE_SQL) 3 4 def migrate_down(manager): 5 manager.execute_script(DROP_TABLE_SQL) 6 7 8 CREATE_TABLE_SQL = """ 9 -- test iteration attributes (key value pairs at an iteration level) 10 CREATE TABLE iteration_attributes ( 11 test_idx int(10) unsigned NOT NULL, -- ref to test table 12 FOREIGN KEY (test_idx) REFERENCES tests(test_idx) ON DELETE CASCADE, 13 iteration INTEGER, -- integer 14 attribute VARCHAR(30), -- attribute name (e.g. 'run_id') 15 value VARCHAR(100), -- attribute value 16 KEY `test_idx` (`test_idx`) 17 ) TYPE=InnoDB; 18 """ 19 20 DROP_TABLE_SQL = """ 21 DROP TABLE iteration_attributes; 22 """ 23