Dateien nach "backend/src" hochladen
This commit is contained in:
@@ -40,6 +40,27 @@ db.exec(`
|
|||||||
);
|
);
|
||||||
|
|
||||||
-- Tool: 3D-Kalkulator
|
-- Tool: 3D-Kalkulator
|
||||||
|
CREATE TABLE IF NOT EXISTS orders (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||||
|
name TEXT NOT NULL,
|
||||||
|
bemerkung TEXT NOT NULL DEFAULT '',
|
||||||
|
status TEXT NOT NULL DEFAULT 'warteliste',
|
||||||
|
custom_price REAL,
|
||||||
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
CREATE TABLE IF NOT EXISTS order_items (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
order_id INTEGER NOT NULL REFERENCES orders(id) ON DELETE CASCADE,
|
||||||
|
calculation_id INTEGER REFERENCES calculations(id) ON DELETE SET NULL,
|
||||||
|
calc_name TEXT NOT NULL,
|
||||||
|
preis_freundschaft REAL NOT NULL,
|
||||||
|
preis_normal REAL NOT NULL,
|
||||||
|
preis_auftrag REAL NOT NULL,
|
||||||
|
stueckzahl INTEGER NOT NULL DEFAULT 1
|
||||||
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS calculations (
|
CREATE TABLE IF NOT EXISTS calculations (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||||
|
|||||||
Reference in New Issue
Block a user