Skip to content

Instantly share code, notes, and snippets.

@notgull
Created September 9, 2019 02:42
Show Gist options
  • Save notgull/e9ae950ede64de1d816306569c89ef53 to your computer and use it in GitHub Desktop.
Save notgull/e9ae950ede64de1d816306569c89ef53 to your computer and use it in GitHub Desktop.
const thread_table_sql = "CREATE TABLE IF NOT EXISTS Threads (" +
"thread_id TEXT PRIMARY KEY," +
"author INTEGER REFERENCES Users(user_id)," +
"board string REFERENCES Boards(board_id)," +
"name TEXT NOT NULL," +
"description TEXT NOT NULL," +
"created_at TIMESTAMP NOT NULL" +
");";
const post_table_sql = "CREATE TABLE IF NOT EXISTS Posts (" +
"post_id TEXT PRIMARY KEY," +
"author INTEGER REFERENCES Users(user_id)," +
"thread TEXT REFERENCES Threads(thread_id)," +
"title TEXT," +
"content TEXT," +
"reply_to string REFERENCES Posts(post_id)," +
"created_at TIMESTAMP NOT NULL" +
");";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment