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 fcc0d6e point at it.
Merge pull request #3647 from pallets/dependabot/pip/pre-commit-2.5.0dependabot-preview[bot]before adoptionfcc0d6e
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);