2024-02-26 00:12:13 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS projects (
|
|
|
|
id INTEGER PRIMARY KEY,
|
2024-02-27 08:05:07 +01:00
|
|
|
projectId TEXT DEFAULT (HEX(RANDOMBLOB(4))) NOT NULL UNIQUE,
|
|
|
|
name VARCHAR(255) NOT NULL UNIQUE,
|
2024-02-26 00:12:13 +01:00
|
|
|
description TEXT NOT NULL,
|
|
|
|
user_id INTEGER NOT NULL,
|
|
|
|
FOREIGN KEY (user_id) REFERENCES users (id)
|
2024-02-27 08:05:07 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE INDEX IF NOT EXISTS projects_projectId_index ON projects (projectId);
|
|
|
|
CREATE INDEX IF NOT EXISTS projects_user_id_index ON projects (user_id);
|