[vhffs-dev] [698] Add some not null to columns which must be not null.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 698
Author:   gradator
Date:     2007-07-08 21:07:25 +0000 (Sun, 08 Jul 2007)

Log Message:
-----------
Add some not null to columns which must be not null.

Modified Paths:
--------------
    trunk/vhffs-backend/src/pgsql/initdb.sql.in
    trunk/vhffs-compat/4.0.sql.in


Modified: trunk/vhffs-backend/src/pgsql/initdb.sql.in
===================================================================
--- trunk/vhffs-backend/src/pgsql/initdb.sql.in	2007-07-08 20:09:48 UTC (rev 697)
+++ trunk/vhffs-backend/src/pgsql/initdb.sql.in	2007-07-08 21:07:25 UTC (rev 698)
@@ -109,10 +109,10 @@
 (
 	cvs_id serial,
 	cvsroot varchar NOT NULL,
-	owner_uid int4, 
-	owner_gid int4,
+	owner_uid int4 NOT NULL, 
+	owner_gid int4 NOT NULL,
 	public boolean NOT NULL,
-	object_id int4,
+	object_id int4 NOT NULL,
 	CONSTRAINT vhffs_cvs_pkey PRIMARY KEY (cvs_id)
 ) WITH OIDS;
 
@@ -120,9 +120,9 @@
 (
 	dns_id serial,
 	domain varchar(255) NOT NULL,
-	owner_gid int4,
-	owner_uid int4,
-	object_id int4,
+	owner_gid int4 NOT NULL,
+	owner_uid int4 NOT NULL,
+	object_id int4 NOT NULL,
 	ns varchar(255) NOT NULL,
 	mbox varchar(255) NOT NULL,
 	serial INTEGER NOT NULL DEFAULT 1,
@@ -205,14 +205,14 @@
 (
 	ml_id serial,
 	local_part varchar(256) NOT NULL,
-	domain varchar(256),
+	domain varchar(256) NOT NULL,
 	prefix varchar(32),
-	owner_uid int4, 
-	owner_gid int4,
-	object_id int4,
+	owner_uid int4 NOT NULL,
+	owner_gid int4 NOT NULL,
+	object_id int4 NOT NULL,
 	admin varchar(250) NOT NULL,
-	sub_ctrl int4,
-	post_ctrl int4,
+	sub_ctrl int4 NOT NULL,
+	post_ctrl int4 NOT NULL,
 	reply_to boolean,
 	open_archive boolean,
 	signature varchar(250),
@@ -235,18 +235,18 @@
 	mysql_id serial,
 	dbname varchar(200) NOT NULL,
 	dbuser varchar(200) NOT NULL,
-	owner_uid int4, 
-	owner_gid int4,
+	owner_uid int4 NOT NULL,
+	owner_gid int4 NOT NULL,
 	dbpass VARCHAR(32) NOT NULL,
-	object_id int4,
+	object_id int4 NOT NULL,
 	CONSTRAINT vhffs_mysql_pkey PRIMARY KEY (mysql_id)
 ) WITH OIDS;
 
 CREATE TABLE vhffs_history
 (
 	history_id serial,
-	object_id int4,
-	date timestamp,
+	object_id int4 NOT NULL,
+	date timestamp NOT NULL,
 	message varchar(200),
 	CONSTRAINT vhffs_history_pkey PRIMARY KEY (history_id)
 ) WITH OIDS;
@@ -257,9 +257,9 @@
 	dbname varchar(200) NOT NULL,
 	dbuser varchar(32) NOT NULL,
 	dbpass varchar(32) NOT NULL,
-	owner_uid int4, 
-	owner_gid int4,
-	object_id int4,
+	owner_uid int4 NOT NULL,
+	owner_gid int4 NOT NULL,
+	object_id int4 NOT NULL,
 	CONSTRAINT vhffs_pgsql_pkey PRIMARY KEY (pgsql_id)
 ) WITH OIDS;
 
@@ -267,21 +267,21 @@
 (
 	svn_id SERIAL,
 	reponame varchar NOT NULL,
-	owner_uid int4, 
-	owner_gid int4,
+	owner_uid int4 NOT NULL,
+	owner_gid int4 NOT NULL,
 	public int4 NOT NULL,
 	ml_name varchar,
-	object_id int4,
+	object_id int4 NOT NULL,
 	CONSTRAINT vhffs_svn_pkey PRIMARY KEY( reponame , owner_gid)
 ) WITH OIDS;
 
 CREATE TABLE vhffs_user_group
 (
-	uid int4 ,
-	gid int4 ,
-	state int4 ,
+	uid int4 NOT NULL,
+	gid int4 NOT NULL,
+	state int4 NOT NULL,
 	CONSTRAINT vhffs_user_group_pkey PRIMARY KEY (uid,gid)
-)WITH OIDS;
+) WITH OIDS;
 
 
 /****** Indexes and unique constraints *******/

Modified: trunk/vhffs-compat/4.0.sql.in
===================================================================
--- trunk/vhffs-compat/4.0.sql.in	2007-07-08 20:09:48 UTC (rev 697)
+++ trunk/vhffs-compat/4.0.sql.in	2007-07-08 21:07:25 UTC (rev 698)
@@ -116,7 +116,14 @@
 ALTER TABLE vhffs_ml DROP url;
 ALTER TABLE vhffs_ml ADD COLUMN signature varchar(250);
 
+ALTER TABLE vhffs_ml ALTER owner_uid SET NOT NULL;
+ALTER TABLE vhffs_ml ALTER owner_gid SET NOT NULL;
+ALTER TABLE vhffs_ml ALTER object_id SET NOT NULL;
+ALTER TABLE vhffs_ml ALTER sub_ctrl SET NOT NULL;
+ALTER TABLE vhffs_ml ALTER post_ctrl SET NOT NULL;
+ALTER TABLE vhffs_ml ALTER domain SET NOT NULL;
 
+
 -- merge vhffs_ml_lang to vhffs_ml_subscribers
 ALTER TABLE vhffs_ml_subscribers ADD COLUMN language varchar(16);
 UPDATE vhffs_ml_subscribers SET language = mll.lang FROM vhffs_ml_lang mll WHERE mll.member = vhffs_ml_subscribers.member;
@@ -186,6 +193,10 @@
 ALTER TABLE vhffs_dns ALTER COLUMN minimum SET NOT NULL;
 ALTER TABLE vhffs_dns ALTER COLUMN ttl SET NOT NULL;
 
+ALTER TABLE vhffs_dns ALTER COLUMN owner_gid SET NOT NULL;
+ALTER TABLE vhffs_dns ALTER COLUMN owner_uid SET NOT NULL;
+ALTER TABLE vhffs_dns ALTER COLUMN object_id SET NOT NULL;
+
 -- DROP TABLE vhffs_dns_soa;
 
 -- Rename vhffs_acl columns, remove unused acl_id
@@ -228,3 +239,32 @@
 ALTER TABLE vhffs_httpd ALTER owner_uid SET NOT NULL;
 ALTER TABLE vhffs_httpd ALTER owner_gid SET NOT NULL;
 ALTER TABLE vhffs_httpd ALTER servername DROP DEFAULT;
+
+-- some alter on vhffs_cvs table
+ALTER TABLE vhffs_cvs ALTER owner_uid SET NOT NULL;
+ALTER TABLE vhffs_cvs ALTER owner_gid SET NOT NULL;
+ALTER TABLE vhffs_cvs ALTER object_id SET NOT NULL;
+
+-- some alter on vhffs_mysql
+ALTER TABLE vhffs_mysql ALTER owner_uid SET NOT NULL;
+ALTER TABLE vhffs_mysql ALTER owner_gid SET NOT NULL;
+ALTER TABLE vhffs_mysql ALTER object_id SET NOT NULL;
+
+-- some alter on vhffs_history
+ALTER TABLE vhffs_history ALTER object_id SET NOT NULL;
+ALTER TABLE vhffs_history ALTER date SET NOT NULL;
+
+-- some alter on vhffs_pgsql
+ALTER TABLE vhffs_pgsql ALTER owner_uid SET NOT NULL;
+ALTER TABLE vhffs_pgsql ALTER owner_gid SET NOT NULL;
+ALTER TABLE vhffs_pgsql ALTER object_id SET NOT NULL;
+
+-- some alter on vhffs_svn
+ALTER TABLE vhffs_svn ALTER owner_uid SET NOT NULL;
+ALTER TABLE vhffs_svn ALTER owner_gid SET NOT NULL;
+ALTER TABLE vhffs_svn ALTER object_id SET NOT NULL;
+
+-- some alter on vhffs_user_group
+ALTER TABLE vhffs_user_group ALTER uid SET NOT NULL;
+ALTER TABLE vhffs_user_group ALTER gid SET NOT NULL;
+ALTER TABLE vhffs_user_group ALTER state SET NOT NULL;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/