Changeset 170

Show
Ignore:
Timestamp:
17/06/06 16:02:42 (3 years ago)
Author:
pwb
Message:

Moved the users table to the top so it doesn't try to create foreign keys on tables that don't exist yet.

Fixed some syntax errors.

It now actually works with psql -f !

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • blog.sql

    r161 r170  
    1 DROP TABLE comments; DROP TABLE entries; DROP TABLE categories; DROP TABLE users; 
    2  
    3 CREATE TABLE categories ( 
    4         id serial NOT NULL PRIMARY KEY, 
    5         name text NOT NULL, 
    6         description text, 
    7         user_id integer REFERENCES users ON DELETE CASCADE 
    8 ); 
     1--DROP TABLE comments; DROP TABLE entries; DROP TABLE categories; DROP TABLE users; 
    92 
    103CREATE TABLE users ( 
     
    1912        enabled bool NOT NULL DEFAULT true, 
    2013        moderate bool NOT NULL DEFAULT true, 
    21         editor bool NOT NULL DEFAULT true; 
     14        editor bool NOT NULL DEFAULT true 
     15); 
     16 
     17CREATE TABLE categories ( 
     18        id serial NOT NULL PRIMARY KEY, 
     19        name text NOT NULL, 
     20        description text, 
     21        user_id integer REFERENCES users ON DELETE CASCADE 
    2222); 
    2323 
     
    4141        body text NOT NULL, 
    4242        host text NOT NULL, 
    43         moderated bool NOT NULL DEFAULT false; 
    44         spam bool NOT NULL DEFAULT false; 
     43        moderated bool NOT NULL DEFAULT false, 
     44        spam bool NOT NULL DEFAULT false 
    4545); 
    4646