Home | History | Annotate | Download | only in migrations
      1 UP_SQL = """
      2 CREATE TABLE afe_static_labels (
      3   id int(11) NOT NULL auto_increment,
      4   name varchar(750) default NULL,
      5   kernel_config varchar(255) default NULL,
      6   platform tinyint(1) default '0',
      7   invalid tinyint(1) NOT NULL,
      8   only_if_needed tinyint(1) NOT NULL,
      9   atomic_group_id int(11) default NULL,
     10   PRIMARY KEY (id),
     11   UNIQUE KEY name (name(50)),
     12   KEY atomic_group_id (atomic_group_id),
     13   CONSTRAINT afe_static_labels_idfk_1
     14   FOREIGN KEY (atomic_group_id)
     15     REFERENCES afe_atomic_groups (id) ON DELETE NO ACTION
     16 ) ENGINE=InnoDB;
     17 
     18 CREATE TABLE afe_static_hosts_labels (
     19   id int(11) NOT NULL auto_increment,
     20   host_id int(11) default NULL,
     21   staticlabel_id int(11) default NULL,
     22   PRIMARY KEY (id),
     23   UNIQUE KEY hosts_labels_both_ids (staticlabel_id,host_id),
     24   KEY hosts_labels_host_id (host_id),
     25   CONSTRAINT static_hosts_labels_host_id_fk
     26   FOREIGN KEY (host_id)
     27     REFERENCES afe_hosts (id) ON DELETE NO ACTION,
     28   CONSTRAINT static_hosts_labels_label_id_fk
     29   FOREIGN KEY (staticlabel_id)
     30     REFERENCES afe_static_labels (id) ON DELETE NO ACTION
     31 ) ENGINE=InnoDB;
     32 """
     33 
     34 DOWN_SQL = """
     35 DROP TABLE IF EXISTS afe_static_labels;
     36 DROP TABLE IF EXISTS afe_static_hosts_labels;
     37 """
     38