From 05c6a7a2ef0d6be3a02b8e1a3e2bd2b6afacf799 Mon Sep 17 00:00:00 2001
From: xue <>
Date: Fri, 6 Apr 2007 03:06:36 +0000
Subject: Finished blog tutorial day 2.

---
 .../samples/day2/blog/protected/schema.sql         | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 demos/blog-tutorial/samples/day2/blog/protected/schema.sql

(limited to 'demos/blog-tutorial/samples/day2/blog/protected/schema.sql')

diff --git a/demos/blog-tutorial/samples/day2/blog/protected/schema.sql b/demos/blog-tutorial/samples/day2/blog/protected/schema.sql
new file mode 100644
index 00000000..085e47c3
--- /dev/null
+++ b/demos/blog-tutorial/samples/day2/blog/protected/schema.sql
@@ -0,0 +1,23 @@
+/* create users table */
+CREATE TABLE users (
+  username      VARCHAR(128) NOT NULL PRIMARY KEY,
+  email         VARCHAR(128) NOT NULL UNIQUE,
+  password      VARCHAR(128) NOT NULL,  /* plain text password */
+  role          INTEGER NOT NULL,       /* 0: normal user, 1: administrator */
+  first_name    VARCHAR(128),
+  last_name     VARCHAR(128)
+);
+
+/* create posts table */
+CREATE TABLE posts (
+  post_id       INTEGER NOT NULL PRIMARY KEY,
+  author        VARCHAR(128) NOT NULL,  /* 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 */
+);
+
+/* insert some initial data records for testing */
+INSERT INTO users VALUES ('admin', 'admin@example.com', 'demo', 1, 'Qiang', 'Xue');
+INSERT INTO users VALUES ('demo', 'demo@example.com', 'demo', 0, 'Wei', 'Zhuo');
+INSERT INTO posts VALUES (NULL, 'admin', 1175708482, 'first post', 'this is my first post');
-- 
cgit v1.2.3

