PRAGMA foreign_keys = ON;
-CREATE TABLE account (
+CREATE TABLE room (
id INTEGER PRIMARY KEY,
- email TEXT,
- username TEXT UNIQUE,
- password TEXT NOT NULL,
- status TEXT DEFAULT 'active'
+ name TEXT UNIQUE,
+ created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-CREATE TABLE message (
+CREATE TABLE account (
id INTEGER PRIMARY KEY,
- posted TIMESTAMP,
- author INTEGER REFERENCES account(id),
- content TEXT
+ username TEXT UNIQUE,
+ password TEXT NOT NULL,
+ status TEXT DEFAULT 'active',
+ current_room INTEGER REFERENCES room(id)
);
-INSERT INTO account (username, password) VALUES ('chaz', 'mypass');
-INSERT INTO account (username, password) VALUES ('jdoe', 'foobar');
-