Modify SQL to add note field to domain_data and users v0.6.x
authormartin f. krafft <madduck@madduck.net>
Sat, 14 Apr 2012 12:58:20 +0200
branchv0.6.x
changeset 538 1f9ea5658627
parent 537 9a23043b0530
child 539 5806fb74130b
Modify SQL to add note field to domain_data and users
pgsql/create_tables-dovecot-1.2.x.pgsql
pgsql/create_tables.pgsql
pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql
pgsql/update_tables_0.5.x-0.6.pgsql
--- a/pgsql/create_tables-dovecot-1.2.x.pgsql	Sat Apr 14 16:02:46 2012 +0000
+++ b/pgsql/create_tables-dovecot-1.2.x.pgsql	Sat Apr 14 12:58:20 2012 +0200
@@ -104,6 +104,7 @@
     ssid        bigint NOT NULL DEFAULT 1, -- default service set
     tid         bigint NOT NULL DEFAULT 1, -- default transport
     domaindir   varchar(40) NOT NULL, --/srv/mail/$RAND/4294967294
+    note        varchar NULL DEFAULT NULL,
     CONSTRAINT  pkey_domain_data PRIMARY KEY (gid),
     CONSTRAINT  fkey_domain_data_qid_quotalimit FOREIGN KEY (qid)
         REFERENCES quotalimit (qid),
@@ -132,6 +133,7 @@
     qid         bigint NULL DEFAULT NULL,
     ssid        bigint NULL DEFAULT NULL,
     tid         bigint NULL DEFAULT NULL,
+    note        varchar NULL DEFAULT NULL,
     CONSTRAINT  pkey_users PRIMARY KEY (local_part, gid),
     CONSTRAINT  ukey_users_uid UNIQUE (uid),
     CONSTRAINT  fkey_users_gid_domain_data FOREIGN KEY (gid)
--- a/pgsql/create_tables.pgsql	Sat Apr 14 16:02:46 2012 +0000
+++ b/pgsql/create_tables.pgsql	Sat Apr 14 12:58:20 2012 +0200
@@ -104,6 +104,7 @@
     ssid        bigint NOT NULL DEFAULT 1, -- default service_set
     tid         bigint NOT NULL DEFAULT 1, -- default transport
     domaindir   varchar(40) NOT NULL, --/srv/mail/$RAND/4294967294
+    note        varchar NULL DEFAULT NULL,
     CONSTRAINT  pkey_domain_data PRIMARY KEY (gid),
     CONSTRAINT  fkey_domain_data_qid_quotalimit FOREIGN KEY (qid)
         REFERENCES quotalimit (qid),
@@ -132,6 +133,7 @@
     qid         bigint NULL DEFAULT NULL,
     ssid        bigint NULL DEFAULT NULL,
     tid         bigint NULL DEFAULT NULL,
+    note        varchar NULL DEFAULT NULL,
     CONSTRAINT  pkey_users PRIMARY KEY (local_part, gid),
     CONSTRAINT  ukey_users_uid UNIQUE (uid),
     CONSTRAINT  fkey_users_gid_domain_data FOREIGN KEY (gid)
--- a/pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql	Sat Apr 14 16:02:46 2012 +0000
+++ b/pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql	Sat Apr 14 12:58:20 2012 +0200
@@ -195,6 +195,13 @@
                WHERE domain_data.gid = users.gid);
 
 -- ---
+-- Account/domain notes
+-- ---
+
+ALTER TABLE users ADD COLUMN note text NULL DEFAULT NULL;
+ALTER TABLE domain_data ADD COLUMN note text NULL DEFAULT NULL;
+
+-- ---
 -- Restore view
 -- ---
 CREATE VIEW vmm_domain_info AS
--- a/pgsql/update_tables_0.5.x-0.6.pgsql	Sat Apr 14 16:02:46 2012 +0000
+++ b/pgsql/update_tables_0.5.x-0.6.pgsql	Sat Apr 14 12:58:20 2012 +0200
@@ -173,6 +173,13 @@
 );
 
 -- ---
+-- Account/domain notes
+-- ---
+
+ALTER TABLE users ADD COLUMN note text NULL DEFAULT NULL;
+ALTER TABLE domain_data ADD COLUMN note text NULL DEFAULT NULL;
+
+-- ---
 -- Restore view
 -- ---
 CREATE VIEW vmm_domain_info AS