From: Charles McGarvey Date: Thu, 13 Oct 2011 04:20:56 +0000 (-0600) Subject: add the db schema to store accounts and chats X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=d4c693d621d476e20ea670aad267c60960963826;p=chaz%2Fchatty add the db schema to store accounts and chats --- 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'); +