1 UP_SQL = """ 2 CREATE TABLE `host_attributes` ( 3 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, 4 `host_id` integer NOT NULL, 5 `attribute` varchar(90) NOT NULL, 6 `value` varchar(300) NOT NULL, 7 FOREIGN KEY (host_id) REFERENCES hosts (id), 8 KEY (attribute) 9 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 10 """ 11 12 DOWN_SQL = """ 13 DROP TABLE IF EXISTS host_attributes; 14 """ 15 16 def migrate_up(manager): 17 manager.execute_script(UP_SQL) 18 19 20 def migrate_down(manager): 21 manager.execute_script(DOWN_SQL) 22