schema.sql
This file
Path
examples/tutorial/flaskr/schema.sql
20 lines · 498 bytes · SQL
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 4d37aca point at it.
Merge pull request #3059 from mattrobenolt/fspathDavid Lordbefore adoption4d37aca
lines 1–20why, one step back1-- Initialize the database.2-- Drop any existing data and create empty tables.34DROP TABLE IF EXISTS user;5DROP TABLE IF EXISTS post;67CREATE TABLE user (8 id INTEGER PRIMARY KEY AUTOINCREMENT,9 username TEXT UNIQUE NOT NULL,10 password TEXT NOT NULL11);1213CREATE TABLE post (14 id INTEGER PRIMARY KEY AUTOINCREMENT,15 author_id INTEGER NOT NULL,16 created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,17 title TEXT NOT NULL,18 body TEXT NOT NULL,19 FOREIGN KEY (author_id) REFERENCES user (id)20);