From d4c693d621d476e20ea670aad267c60960963826 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Wed, 12 Oct 2011 22:20:56 -0600 Subject: [PATCH] add the db schema to store accounts and chats --- db/schema.sql | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 db/schema.sql diff --git a/db/schema.sql b/db/schema.sql new file mode 100644 index 0000000..0b8a710 --- /dev/null +++ b/db/schema.sql @@ -0,0 +1,20 @@ + +PRAGMA foreign_keys = ON; + +CREATE TABLE account ( + id INTEGER PRIMARY KEY, + username TEXT, + password TEXT, + status TEXT DEFAULT 'active' +); + +CREATE TABLE message ( + id INTEGER PRIMARY KEY, + posted TIMESTAMP, + author INTEGER REFERENCES account(id), + content TEXT +); + +INSERT INTO account (username, password) VALUES ('chaz', 'mypass'); +INSERT INTO account (username, password) VALUES ('jdoe', 'foobar'); + -- 2.45.2