TTime/backend/internal/database/migrations/0020_projects.sql

9 lines
312 B
MySQL
Raw Normal View History

2024-02-26 00:12:13 +01:00
CREATE TABLE IF NOT EXISTS projects (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(255) NOT NULL UNIQUE,
2024-02-26 00:12:13 +01:00
description TEXT NOT NULL,
owner_user_id INTEGER NOT NULL,
FOREIGN KEY (owner_user_id) REFERENCES users (id)
);
CREATE INDEX IF NOT EXISTS projects_user_id_index ON projects (owner_user_id);