]> Dogcows Code - chaz/chatty/commitdiff
add the db schema to store accounts and chats
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 13 Oct 2011 04:20:56 +0000 (22:20 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 13 Oct 2011 04:20:56 +0000 (22:20 -0600)
db/schema.sql [new file with mode: 0644]

diff --git a/db/schema.sql b/db/schema.sql
new file mode 100644 (file)
index 0000000..0b8a710
--- /dev/null
@@ -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');
+
This page took 0.020165 seconds and 4 git commands to generate.