Skip to content
Myr

schema.sql

This file

Path

examples/tutorial/flaskr/schema.sql

20 lines · 498 bytes · SQL

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 2062d98 point at it.

Merge pull request #3564 from pallets/cli-ast-parseDavid Lordbefore adoption2062d98

lines 1–20why, one step back
1-- 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);