summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-03-01 18:55:40 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-03-01 18:55:40 +0100
commit2ecae6b9caab5073a8e9fece4a32b835eef706a8 (patch)
tree54ecd7d082bc825c3066566a92dc9a93080320e9
parente5b314f7f236454b40431c463168f188b2545264 (diff)
Add remark about the possible use of enum types in PostgreSQL 9.1.
-rw-r--r--schema.sql13
1 files changed, 13 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql
index 185a777..6304790 100644
--- a/schema.sql
+++ b/schema.sql
@@ -1,5 +1,18 @@
BEGIN TRANSACTION;
+-- For PostgreSQL 9.1 upward, we should consider using enum types
+-- instead of VARCHARs with CHECK constraints:
+--
+-- CREATE TYPE user_status AS
+-- ENUM ('pending', 'approved', 'trusted', 'deferred', 'disabled', 'admin');
+--
+-- CREATE TYPE comment_status AS
+-- ENUM ('pending', 'approved', 'trusted', 'deferred', 'spam', 'rejected');
+--
+-- CREATE TYPE text_format AS
+-- ENUM ('html', 'text');
+
+
CREATE TABLE users(
id SERIAL NOT NULL,
name VARCHAR,