messing around with flask tutorial

schema.sql 437B

123456789101112131415161718
  1. DROP TABLE IF EXISTS user;
  2. DROP TABLE IF EXISTS post;
  3. CREATE TABLE user (
  4. id INTEGER PRIMARY KEY AUTOINCREMENT,
  5. username TEXT UNIQUE NOT NULL,
  6. password TEXT NOT NULL
  7. );
  8. CREATE TABLE post (
  9. id INTEGER PRIMARY KEY AUTOINCREMENT,
  10. author_id INTEGER NOT NULL,
  11. created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  12. title TEXT NOT NULL,
  13. body TEXT NOT NULL,
  14. FOREIGN KEY (author_id) REFERENCES user (id)
  15. );