diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-03-01 18:55:40 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-03-01 18:55:40 +0100 |
commit | 2ecae6b9caab5073a8e9fece4a32b835eef706a8 (patch) | |
tree | 54ecd7d082bc825c3066566a92dc9a93080320e9 | |
parent | e5b314f7f236454b40431c463168f188b2545264 (diff) |
Add remark about the possible use of enum types in PostgreSQL 9.1.
-rw-r--r-- | schema.sql | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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, |