summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-12-03 08:02:32 +0000
committeralecpl <alec@alec.pl>2008-12-03 08:02:32 +0000
commita493ea8e48ddaa28090c2b74251654376462ebb6 (patch)
tree7fc6473ab2d5619ece40f362d8e316c03d2787fd
parentf1f17fa5a4284011bd4dbc00b33b61785fd5c645 (diff)
- change few "boolean" columns type from integer to smallint
-rw-r--r--SQL/postgres.initial.sql8
-rw-r--r--SQL/postgres.update.sql5
2 files changed, 9 insertions, 4 deletions
diff --git a/SQL/postgres.initial.sql b/SQL/postgres.initial.sql
index d2e56980b..eb53332bf 100644
--- a/SQL/postgres.initial.sql
+++ b/SQL/postgres.initial.sql
@@ -65,8 +65,8 @@ CREATE SEQUENCE identity_ids
CREATE TABLE identities (
identity_id integer DEFAULT nextval('identity_ids'::text) PRIMARY KEY,
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
- del integer DEFAULT 0 NOT NULL,
- standard integer DEFAULT 0 NOT NULL,
+ del smallint DEFAULT 0 NOT NULL,
+ standard smallint DEFAULT 0 NOT NULL,
name character varying(128) NOT NULL,
organization character varying(128),
email character varying(128) NOT NULL,
@@ -100,7 +100,7 @@ CREATE TABLE contacts (
contact_id integer DEFAULT nextval('contact_ids'::text) PRIMARY KEY,
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
changed timestamp with time zone DEFAULT now() NOT NULL,
- del integer DEFAULT 0 NOT NULL,
+ del smallint DEFAULT 0 NOT NULL,
name character varying(128) DEFAULT ''::character varying NOT NULL,
email character varying(128) DEFAULT ''::character varying NOT NULL,
firstname character varying(128) DEFAULT ''::character varying NOT NULL,
@@ -156,7 +156,7 @@ CREATE SEQUENCE message_ids
CREATE TABLE messages (
message_id integer DEFAULT nextval('message_ids'::text) PRIMARY KEY,
user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
- del integer DEFAULT 0 NOT NULL,
+ del smallint DEFAULT 0 NOT NULL,
cache_key character varying(128) DEFAULT ''::character varying NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
idx integer DEFAULT 0 NOT NULL,
diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql
index 5dae5a28a..a29558e66 100644
--- a/SQL/postgres.update.sql
+++ b/SQL/postgres.update.sql
@@ -31,3 +31,8 @@ CREATE INDEX cache_created_idx ON "cache" (created);
ALTER TABLE users ALTER "language" DROP NOT NULL;
ALTER TABLE users ALTER "language" DROP DEFAULT;
+
+ALTER TABLE identities ALTER del TYPE smallint;
+ALTER TABLE identities ALTER standard TYPE smallint;
+ALTER TABLE contacts ALTER del TYPE smallint;
+ALTER TABLE messages ALTER del TYPE smallint;