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