Added domainoption: php (data base changes only)
This commit is contained in:
parent
34242861e7
commit
e5fe2a57f7
@ -166,3 +166,5 @@ INSERT INTO domain_option (domain_option_name)
|
|||||||
VALUES ('indexes');
|
VALUES ('indexes');
|
||||||
INSERT INTO domain_option (domain_option_name)
|
INSERT INTO domain_option (domain_option_name)
|
||||||
VALUES ('multiviews');
|
VALUES ('multiviews');
|
||||||
|
INSERT INTO domain_option (domain_option_name)
|
||||||
|
VALUES ('php');
|
||||||
|
@ -1,80 +1,31 @@
|
|||||||
-- Migrate database from version 2.1 to version 2.2
|
-- Migrate database from version 2.2 to version 2.3
|
||||||
--
|
--
|
||||||
-- domain options
|
|
||||||
--
|
|
||||||
CREATE SEQUENCE domain_option_id_seq
|
|
||||||
INCREMENT BY 1
|
|
||||||
NO MAXVALUE
|
|
||||||
NO MINVALUE
|
|
||||||
CACHE 1;
|
|
||||||
|
|
||||||
CREATE TABLE domain_option (
|
|
||||||
domain_option_id integer DEFAULT nextval(('"domain_option_id_seq"'::text)::regclass) NOT NULL,
|
|
||||||
domain_option_name character varying(50) NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE ONLY domain_option
|
|
||||||
ADD CONSTRAINT pk_domain_option PRIMARY KEY (domain_option_id);
|
|
||||||
|
|
||||||
CREATE UNIQUE INDEX domain_option_name_idx ON domain_option USING btree ( domain_option_name );
|
|
||||||
|
|
||||||
CREATE TABLE domain__domain_option (
|
|
||||||
domain_option_id integer NOT NULL,
|
|
||||||
domain_id integer NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE ONLY domain__domain_option
|
|
||||||
ADD CONSTRAINT pk_domain__domain_option PRIMARY KEY (domain_option_id, domain_id);
|
|
||||||
|
|
||||||
ALTER TABLE ONLY domain__domain_option
|
|
||||||
ADD CONSTRAINT domain_option_id_fkey FOREIGN KEY (domain_option_id)
|
|
||||||
REFERENCES domain_option(domain_option_id) DEFERRABLE;
|
|
||||||
|
|
||||||
ALTER TABLE ONLY domain__domain_option
|
|
||||||
ADD CONSTRAINT domain_id_fkey FOREIGN KEY (domain_id)
|
|
||||||
REFERENCES domain(domain_id) DEFERRABLE;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- table: domain_option
|
-- table: domain_option
|
||||||
--
|
--
|
||||||
INSERT INTO domain_option (domain_option_name)
|
INSERT INTO domain_option (domain_option_name)
|
||||||
VALUES ('backupmxforexternalmx');
|
VALUES ('php');
|
||||||
INSERT INTO domain_option (domain_option_name)
|
|
||||||
VALUES ('greylisting');
|
|
||||||
INSERT INTO domain_option (domain_option_name)
|
|
||||||
VALUES ('htdocsfallback');
|
|
||||||
INSERT INTO domain_option (domain_option_name)
|
|
||||||
VALUES ('includes');
|
|
||||||
INSERT INTO domain_option (domain_option_name)
|
|
||||||
VALUES ('indexes');
|
|
||||||
INSERT INTO domain_option (domain_option_name)
|
|
||||||
VALUES ('multiviews');
|
|
||||||
--
|
--
|
||||||
-- new domain options settings
|
-- new domain options settings
|
||||||
--
|
--
|
||||||
-- existing default = ON
|
-- existing default = On for DW-packet, Off otherwise.
|
||||||
--
|
--
|
||||||
INSERT INTO domain__domain_option SELECT domain_option_id, domain_id
|
INSERT INTO domain__domain_option SELECT domain_option_id, domain_id
|
||||||
FROM domain, domain_option
|
FROM domain
|
||||||
WHERE domain_option.domain_option_name = 'greylisting' ;
|
JOIN unixuser on ( domain.domain_owner = unixuser.unixuser_id )
|
||||||
INSERT INTO domain__domain_option SELECT domain_option_id, domain_id
|
JOIN packet on ( unixuser.packet_id = packet.packet_id )
|
||||||
FROM domain, domain_option
|
JOIN basepacket on ( packet.bp_id = basepacket.basepacket_id )
|
||||||
WHERE domain_option.domain_option_name = 'htdocsfallback' ;
|
, domain_option
|
||||||
INSERT INTO domain__domain_option SELECT domain_option_id, domain_id
|
WHERE basepacket.basepacket_code = 'DW/B'
|
||||||
FROM domain, domain_option
|
AND domain_option.domain_option_name = 'php' ;
|
||||||
WHERE domain_option.domain_option_name = 'includes' ;
|
DELETE FROM domain__domain_option USING domain_option, domain
|
||||||
INSERT INTO domain__domain_option SELECT domain_option_id, domain_id
|
JOIN unixuser on ( domain.domain_owner = unixuser.unixuser_id )
|
||||||
FROM domain, domain_option
|
JOIN packet on ( unixuser.packet_id = packet.packet_id )
|
||||||
WHERE domain_option.domain_option_name = 'indexes' ;
|
JOIN basepacket on ( packet.bp_id = basepacket.basepacket_id )
|
||||||
INSERT INTO domain__domain_option SELECT domain_option_id, domain_id
|
WHERE basepacket.basepacket_code != 'DW/B'
|
||||||
FROM domain, domain_option
|
AND domain__domain_option.domain_option_id = domain_option.domain_option_id
|
||||||
WHERE domain_option.domain_option_name = 'multiviews' ;
|
AND domain_option.domain_option_name = 'php' ;
|
||||||
--
|
--
|
||||||
-- existing default = OFF
|
-- End of migration to version 2.3
|
||||||
--
|
|
||||||
DELETE FROM domain__domain_option USING domain_option
|
|
||||||
WHERE domain__domain_option.domain_option_id = domain_option.domain_option_id
|
|
||||||
AND domain_option.domain_option_name = 'backupmxforexternalmx' ;
|
|
||||||
--
|
|
||||||
-- End of migratino to version 2.2
|
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user