diff options
author | wei <> | 2007-05-10 23:00:04 +0000 |
---|---|---|
committer | wei <> | 2007-05-10 23:00:04 +0000 |
commit | e2cb0b52aaa02a3f3f41d0df377d189529713738 (patch) | |
tree | ee4c2a3fece40c9a2d4dde75f6e758f7ef05f8f6 /demos/blog-tutorial/samples/day2/blog/protected/schema.sql | |
parent | ef2fc3942664d4d7131542080e838f7754a3081f (diff) |
Update blog tutorial
Diffstat (limited to 'demos/blog-tutorial/samples/day2/blog/protected/schema.sql')
-rw-r--r-- | demos/blog-tutorial/samples/day2/blog/protected/schema.sql | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/demos/blog-tutorial/samples/day2/blog/protected/schema.sql b/demos/blog-tutorial/samples/day2/blog/protected/schema.sql index d3189b40..89f7388e 100644 --- a/demos/blog-tutorial/samples/day2/blog/protected/schema.sql +++ b/demos/blog-tutorial/samples/day2/blog/protected/schema.sql @@ -11,11 +11,12 @@ CREATE TABLE users ( /* create posts table */
CREATE TABLE posts (
post_id INTEGER NOT NULL PRIMARY KEY,
- author VARCHAR(128) NOT NULL, /* references users.username */
+ author_id VARCHAR(128) NOT NULL
+ CONSTRAINT fk_author REFERENCES users(username),
create_time INTEGER NOT NULL, /* UNIX timestamp */
title VARCHAR(256) NOT NULL, /* title of the post */
- content TEXT NOT NULL, /* content of the post */
- status INTEGER NOT NULL /* 0: published; 1: draft; 2: pending; 2: denied */
+ content TEXT, /* post body */
+ status INTEGER NOT NULL /* 0: published; 1: draft; 2: pending; 2: denied */
);
/* insert some initial data records for testing */
|