Commit 6466015c authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(install): table domains_kvm

parent 07217276
......@@ -1397,6 +1397,9 @@ sub _add_indexes_generic($self) {
,"unique (id_domain,name):name"
,"unique(id_vm,public_port)"
]
,domains_kvm => [
"unique (id_domain)"
]
,group_access => [
"unique (id_domain,name)"
,"index(id_domain)"
......@@ -1973,6 +1976,13 @@ sub _sql_create_tables($self) {
,'id_vm' => 'int(11) DEFAULT NULL'
}
]
,[
domains_kvm => {
id => 'integer NOT NULL PRIMARY KEY AUTO_INCREMENT'
,id_domain => 'integer NOT NULL references `domains` (`id`) ON DELETE CASCADE'
,xml => 'TEXT'
}
]
,[
group_access => {
id => 'integer NOT NULL PRIMARY KEY AUTO_INCREMENT'
......@@ -2491,7 +2501,6 @@ sub _upgrade_tables {
$self->_upgrade_table('domains_network','allowed','int not null default 1');
$self->_upgrade_table('domains_kvm','xml','TEXT');
$self->_upgrade_table('iptables','id_vm','int DEFAULT NULL');
$self->_upgrade_table('vms','security','varchar(255) default NULL');
$self->_upgrade_table('grant_types','enabled','int not null default 1');
......
CREATE TABLE `domains_kvm` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_domain` int(11) NOT NULL,
`xml` varchar(8092) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_domain` (`id_domain`)
);
CREATE TABLE `domains_kvm` (
`id` integer NOT NULL PRIMARY KEY AUTOINCREMENT
, `id_domain` integer NOT NULL
, `xml` varchar(8092) DEFAULT NULL
, UNIQUE (`id_domain`)
);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment