forked from inex/IXP-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema-v3-to-v4.sql
31 lines (31 loc) · 2.45 KB
/
schema-v3-to-v4.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
ALTER TABLE api_keys DROP FOREIGN KEY FK_87A61477A76ED395;
DROP INDEX uniq_87a61477800a1141 ON api_keys;
CREATE UNIQUE INDEX UNIQ_9579321F800A1141 ON api_keys (apiKey);
DROP INDEX idx_87a61477a76ed395 ON api_keys;
CREATE INDEX IDX_9579321FA76ED395 ON api_keys (user_id);
ALTER TABLE api_keys ADD CONSTRAINT FK_87A61477A76ED395 FOREIGN KEY (user_id) REFERENCES user (id);
ALTER TABLE bgpsessiondata CHANGE packetcount packetcount INT DEFAULT 0;
ALTER TABLE company_billing_detail CHANGE purchaseOrderRequired purchaseOrderRequired TINYINT(1) DEFAULT '0' NOT NULL;
ALTER TABLE contact CHANGE facilityaccess facilityaccess TINYINT(1) DEFAULT '0' NOT NULL, CHANGE mayauthorize mayauthorize TINYINT(1) DEFAULT '0' NOT NULL;
ALTER TABLE contact_group CHANGE active active TINYINT(1) DEFAULT '1' NOT NULL, CHANGE limited_to limited_to INT DEFAULT 0 NOT NULL;
ALTER TABLE cust CHANGE MD5Support MD5Support VARCHAR(255) DEFAULT 'UNKNOWN', CHANGE isReseller isReseller TINYINT(1) DEFAULT '0' NOT NULL;
ALTER TABLE cust_notes CHANGE private private TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE infrastructure CHANGE isPrimary isPrimary TINYINT(1) DEFAULT '0' NOT NULL;
ALTER TABLE irrdb_prefix DROP FOREIGN KEY FK_873CF9E69395C3F3;
DROP INDEX idx_873cf9e69395c3f3 ON irrdb_prefix;
CREATE INDEX IDX_FE73E77C9395C3F3 ON irrdb_prefix (customer_id);
ALTER TABLE irrdb_prefix ADD CONSTRAINT FK_873CF9E69395C3F3 FOREIGN KEY (customer_id) REFERENCES cust (id);
ALTER TABLE location ADD pdb_facility_id BIGINT DEFAULT NULL;
ALTER TABLE netinfo CHANGE ix ix INT DEFAULT 0 NOT NULL;
ALTER TABLE rs_prefixes DROP FOREIGN KEY FK_7E96E608DA0209B9;
DROP INDEX idx_7e96e608da0209b9 ON rs_prefixes;
CREATE INDEX IDX_29FA9871DA0209B9 ON rs_prefixes (custid);
ALTER TABLE rs_prefixes ADD CONSTRAINT FK_7E96E608DA0209B9 FOREIGN KEY (custid) REFERENCES cust (id);
ALTER TABLE switch CHANGE active active TINYINT(1) DEFAULT '1';
ALTER TABLE switchport CHANGE active active TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE user_pref CHANGE ix ix INT DEFAULT 0 NOT NULL, CHANGE expire expire BIGINT DEFAULT 0 NOT NULL;
ALTER TABLE vlan CHANGE private private TINYINT(1) DEFAULT '0' NOT NULL;
ALTER TABLE vlaninterface CHANGE ipv4enabled ipv4enabled TINYINT(1) DEFAULT '0', CHANGE ipv6enabled ipv6enabled TINYINT(1) DEFAULT '0', CHANGE mcastenabled mcastenabled TINYINT(1) DEFAULT '0', CHANGE irrdbfilter irrdbfilter TINYINT(1) DEFAULT '1';
DROP TABLE change_log;
DROP TABLE sec_event;
CREATE INDEX idx_timestamp ON bgpsessiondata (timestamp);