From 2ecae6b9caab5073a8e9fece4a32b835eef706a8 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 1 Mar 2011 18:55:40 +0100 Subject: Add remark about the possible use of enum types in PostgreSQL 9.1. --- schema.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'schema.sql') 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, -- cgit v1.2.3