2010-11-16 17:11:06 +00:00
-- Alter table to allow use of ipv6, cname and txt in dns record
ALTER TABLE sub_domaines DROP PRIMARY KEY ;
2011-01-28 15:55:26 +00:00
ALTER TABLE sub_domaines ADD CONSTRAINT pk_SubDomaines PRIMARY KEY ( compte , domaine , sub , type , valeur ) ;
2010-12-20 15:04:19 +00:00
-- Alter table mail_domain to add support of temporary mail
ALTER TABLE mail_domain ADD expiration_date datetime DEFAULT null ;
2011-01-28 15:55:26 +00:00
-- Domains type
CREATE TABLE IF NOT EXISTS ` domaines_type ` (
` name ` VARCHAR ( 255 ) NOT NULL , -- Uniq name
` description ` TEXT , -- Human description
` target ` enum ( ' NONE ' , ' URL ' , ' DIRECTORY ' , ' IP ' , ' IPV6 ' , ' DOMAIN ' , ' TXT ' ) NOT NULL DEFAULT ' NONE ' , -- Target type
` entry ` VARCHAR ( 255 ) DEFAULT ' ' , -- BIND entry
` compatibility ` VARCHAR ( 255 ) DEFAULT ' ' , -- Which type can be on the same subdomains
2011-03-06 15:03:51 +00:00
` enable ` enum ( ' ALL ' , ' NONE ' , ' ADMIN ' ) NOT NULL DEFAULT ' ALL ' , -- Show this option to who ?
2011-01-28 15:55:26 +00:00
` only_dns ` BOOLEAN DEFAULT FALSE , -- Update_domains modify just the dns, no web configuration
` need_dns ` BOOLEAN DEFAULT TRUE , -- The server need to be the DNS to allow this service
2011-03-06 15:03:51 +00:00
` advanced ` BOOLEAN DEFAULT TRUE , -- It's an advanced option
2011-01-28 15:55:26 +00:00
PRIMARY KEY ( ` name ` )
) COMMENT = ' Type of domains allowed ' ;
2011-03-06 15:03:51 +00:00
INSERT IGNORE INTO ` domaines_type ` ( name , description , target , entry , compatibility , only_dns , need_dns , advanced ) values
2011-03-27 13:21:09 +00:00
( ' vhost ' , ' Locally hosted ' , ' DIRECTORY ' , ' %SUB% IN A @@PUBLIC_IP@@ ' , ' txt ' , false , false , false ) ,
2011-03-06 15:03:51 +00:00
( ' url ' , ' URL redirection ' , ' URL ' , ' %SUB% IN A @@PUBLIC_IP@@ ' , ' txt ' , true , true , false ) ,
2011-03-28 13:15:47 +00:00
( ' ip ' , ' IPv4 redirect ' , ' IP ' , ' %SUB% IN A %TARGET% ' , ' url,ip,ipv6,txt,mx,mx2,defmx,defmx2 ' , false , true , false ) ,
2011-03-06 15:03:51 +00:00
( ' webmail ' , ' Webmail access ' , ' NONE ' , ' %SUB% IN A @@PUBLIC_IP@@ ' , ' txt ' , false , false , false ) ,
2011-03-28 13:15:47 +00:00
( ' ipv6 ' , ' IPv6 redirect ' , ' IPV6 ' , ' %SUB% IN AAAA %TARGET% ' , ' ip,ipv6,webmail,txt,mx,mx2,defmx,defmx2 ' , true , true , true ) ,
( ' cname ' , ' CNAME DNS entry ' , ' DOMAIN ' , ' %SUB% CNAME %TARGET% ' , ' txt,mx,mx2,defmx,defmx2 ' , true , true , true ) ,
( ' txt ' , ' TXT DNS entry ' , ' TXT ' , ' %SUB% IN TXT "%TARGET%" ' , ' vhost,url,ip,webmail,ipv6,cname,txt,mx,mx2,defmx,defmx2 ' , true , true , true ) ,
2011-03-28 08:04:18 +00:00
( ' mx ' , ' MX DNS entry ' , ' DOMAIN ' , ' %SUB% IN MX 5 %TARGET% ' , ' vhost,url,ip,webmail,ipv6,cname,txt,mx,mx2 ' , true , false , true ) ,
2011-03-28 13:15:47 +00:00
( ' mx2 ' , ' secondary MX DNS entry ' , ' DOMAIN ' , ' %SUB% IN MX 10 %TARGET% ' , ' vhost,url,ip,webmail,ipv6,cname,txt,mx,mx2 ' , true , false , true ) ,
( ' defmx ' , ' Default mail server ' , ' NONE ' , ' %SUB% IN MX 5 @@DEFAULT_MX@@ ' , ' vhost,url,ip,webmail,ipv6,cname,txt,defmx2 ' , true , false , true ) ,
( ' defmx2 ' , ' Default backup mail server ' , ' DOMAIN ' , ' %SUB% IN MX 10 @@DEFAULT_SECONDARY_MX@@ ' , ' vhost,url,ip,webmail,ipv6,cname,txt,defmx ' , true , false , true ) ,
2011-03-28 08:04:18 +00:00
( ' panel ' , ' AlternC panel access ' , ' NONE ' , ' %SUB% IN A @@PUBLIC_IP@@ ' , ' vhost,url,ip,webmail,ipv6,cname,txt,mx,mx2 ' , true , false , true )
2011-01-28 15:55:26 +00:00
;
2011-02-09 09:09:14 +00:00
-- Changing standby use
2011-01-28 15:55:26 +00:00
alter table domaines add column dns_action enum ( ' OK ' , ' UPDATE ' , ' DELETE ' ) NOT NULL default ' UPDATE ' ;
alter table domaines add column dns_result varchar ( 255 ) not null default ' ' ;
2011-01-29 17:58:19 +00:00
alter table sub_domaines add column web_action enum ( ' OK ' , ' UPDATE ' , ' DELETE ' ) NOT NULL default ' UPDATE ' ;
2011-02-01 13:06:40 +00:00
alter table sub_domaines add column web_result varchar ( 255 ) not null default ' ' ;
2011-01-29 17:58:19 +00:00
alter table sub_domaines add column enable enum ( ' ENABLED ' , ' ENABLE ' , ' DISABLED ' , ' DISABLE ' ) NOT NULL DEFAULT ' ENABLED ' ;
2011-01-28 15:55:26 +00:00
drop table sub_domaines_standby ;
drop table domaines_standby ;
2011-03-06 15:03:51 +00:00
update sub_domaines set type = ' VHOST ' where type = ' 0 ' ; -- We decide to drop massvhost.
2011-01-28 15:55:26 +00:00
update sub_domaines set type = ' URL ' where type = ' 1 ' ;
update sub_domaines set type = ' IP ' where type = ' 2 ' ;
update sub_domaines set type = ' WEBMAIL ' where type = ' 3 ' ;
update sub_domaines set type = ' IPV6 ' where type = ' 4 ' ;
update sub_domaines set type = ' CNAME ' where type = ' 5 ' ;
update sub_domaines set type = ' TXT ' where type = ' 6 ' ;
2011-03-06 15:03:51 +00:00
update sub_domaines set web_action = ' UPDATE ' ;
2011-02-01 22:50:58 +00:00