• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1UP_SQL = """
2CREATE 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
12DOWN_SQL = """
13DROP TABLE IF EXISTS host_attributes;
14"""
15
16def migrate_up(manager):
17    manager.execute_script(UP_SQL)
18
19
20def migrate_down(manager):
21    manager.execute_script(DOWN_SQL)
22