vibes
This commit is contained in:
@@ -32,6 +32,14 @@ CREATE TABLE IF NOT EXISTS items (
|
||||
position REAL NOT NULL DEFAULT 0,
|
||||
sublist_id INTEGER REFERENCES sublists(id),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS recurring_items (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
list_id TEXT NOT NULL REFERENCES lists(id),
|
||||
name TEXT NOT NULL,
|
||||
sublist_id INTEGER REFERENCES sublists(id),
|
||||
position REAL NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);`
|
||||
|
||||
const mysqlSchema = `
|
||||
@@ -58,6 +66,16 @@ CREATE TABLE IF NOT EXISTS items (
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (list_id) REFERENCES lists(id),
|
||||
FOREIGN KEY (sublist_id) REFERENCES sublists(id)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS recurring_items (
|
||||
id INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
list_id VARCHAR(64) NOT NULL,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
sublist_id INTEGER,
|
||||
position DOUBLE NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (list_id) REFERENCES lists(id),
|
||||
FOREIGN KEY (sublist_id) REFERENCES sublists(id)
|
||||
);`
|
||||
|
||||
const postgresSchema = `
|
||||
@@ -81,6 +99,14 @@ CREATE TABLE IF NOT EXISTS items (
|
||||
position DOUBLE PRECISION NOT NULL DEFAULT 0,
|
||||
sublist_id INTEGER REFERENCES sublists(id),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS recurring_items (
|
||||
id SERIAL PRIMARY KEY,
|
||||
list_id TEXT NOT NULL REFERENCES lists(id),
|
||||
name TEXT NOT NULL,
|
||||
sublist_id INTEGER REFERENCES sublists(id),
|
||||
position DOUBLE PRECISION NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);`
|
||||
|
||||
// querier is the subset of *sql.DB every handler uses. Postgres needs its own
|
||||
|
||||
Reference in New Issue
Block a user