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
|
|
|
|
`enable` BOOLEAN DEFAULT TRUE, -- Show this options to the users ?
|
|
|
|
`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
|
|
|
|
PRIMARY KEY ( `name` )
|
|
|
|
) COMMENT = 'Type of domains allowed';
|
|
|
|
|
|
|
|
INSERT IGNORE INTO `domaines_type` (name, description, target, entry, compatibility, only_dns, need_dns) values
|
|
|
|
('local','Locally managed', 'DIRECTORY', '%SUB% IN A @@PUBLIC_IP@@', 'txt', false, false),
|
|
|
|
('url','URL redirection', 'URL', '%SUB% IN A @@PUBLIC_IP@@','txt', true, true),
|
|
|
|
('ip','IP redirection', 'IP', '%SUB% IN A %TARGET%','url,ip,ipv6,txt', true, true),
|
|
|
|
('webmail', 'Webmail access', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'txt', false, false),
|
|
|
|
('ipv6','ipv6 address', 'IPV6', '%SUB% IN AAAA %TARGET%','ip,ipv6,webmail,txt',true, true),
|
|
|
|
('cname', 'cname entry', 'DOMAIN', '%SUB% CNAME %TARGET%', 'txt',true, true),
|
|
|
|
('txt', 'txt entry', 'TXT', '%SUB% IN TXT "%TARGET%"','local,url,ip,webmail,ipv6,cname,txt',true, true),
|
|
|
|
('mx', 'mx entry', 'IP', '%SUB% IN MX %TARGET%', 'local,url,ip,webmail,ipv6,cname,txt',true, false)
|
|
|
|
;
|
|
|
|
|
|
|
|
-- Changing stanby use
|
|
|
|
-- TODO modify mysql.sh to add this changes
|
|
|
|
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 '';
|
|
|
|
alter table sub_domaines add column web_action enum ('OK','UPDATE','DELETE') NOT NULL default 'UPDATE';
|
|
|
|
alter table sub add column dns_result varchar(255) not null default '';
|
|
|
|
drop table sub_domaines_standby;
|
|
|
|
drop table domaines_standby;
|
|
|
|
|
|
|
|
update sub_domaines set type='LOCAL' where type='0';
|
|
|
|
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';
|
|
|
|
|