You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
434 B
MySQL
16 lines
434 B
MySQL
2 years ago
|
DROP TABLE IF EXISTS lists;
|
||
|
DROP TABLE IF EXISTS items;
|
||
|
|
||
|
CREATE TABLE lists (
|
||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||
|
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
title TEXT NOT NULL
|
||
|
);
|
||
|
|
||
|
CREATE TABLE items (
|
||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||
|
list_id INTEGER NOT NULL,
|
||
|
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
content TEXT NOT NULL,
|
||
|
FOREIGN KEY (list_id) REFERENCES lists (id)
|
||
|
);
|