Files
vibe-kanban/backend/migrations/20250617183714_init.sql

45 lines
1.7 KiB
MySQL
Raw Normal View History

2025-06-17 15:22:47 -04:00
PRAGMA foreign_keys = ON;
CREATE TABLE projects (
2025-06-17 19:43:11 -04:00
id BLOB PRIMARY KEY,
2025-06-17 15:22:47 -04:00
name TEXT NOT NULL,
git_repo_path TEXT NOT NULL DEFAULT '' UNIQUE,
2025-06-19 11:09:32 -04:00
setup_script TEXT DEFAULT '',
2025-06-19 12:06:08 -04:00
created_at TEXT NOT NULL DEFAULT (datetime('now', 'subsec')),
updated_at TEXT NOT NULL DEFAULT (datetime('now', 'subsec'))
2025-06-17 15:22:47 -04:00
);
CREATE TABLE tasks (
2025-06-17 19:43:11 -04:00
id BLOB PRIMARY KEY,
project_id BLOB NOT NULL,
2025-06-17 15:22:47 -04:00
title TEXT NOT NULL,
description TEXT,
status TEXT NOT NULL DEFAULT 'todo'
CHECK (status IN ('todo','inprogress','done','cancelled','inreview')),
2025-06-19 12:06:08 -04:00
created_at TEXT NOT NULL DEFAULT (datetime('now', 'subsec')),
updated_at TEXT NOT NULL DEFAULT (datetime('now', 'subsec')),
2025-06-17 15:22:47 -04:00
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
);
CREATE TABLE task_attempts (
2025-06-17 19:43:11 -04:00
id BLOB PRIMARY KEY,
task_id BLOB NOT NULL,
2025-06-17 15:22:47 -04:00
worktree_path TEXT NOT NULL,
merge_commit TEXT,
2025-06-17 19:43:11 -04:00
executor TEXT,
2025-06-17 15:22:47 -04:00
stdout TEXT,
stderr TEXT,
2025-06-19 12:06:08 -04:00
created_at TEXT NOT NULL DEFAULT (datetime('now', 'subsec')),
updated_at TEXT NOT NULL DEFAULT (datetime('now', 'subsec')),
2025-06-17 15:22:47 -04:00
FOREIGN KEY (task_id) REFERENCES tasks(id) ON DELETE CASCADE
);
CREATE TABLE task_attempt_activities (
2025-06-17 19:43:11 -04:00
id BLOB PRIMARY KEY,
task_attempt_id BLOB NOT NULL,
2025-06-17 15:22:47 -04:00
status TEXT NOT NULL DEFAULT 'init'
2025-06-19 11:09:32 -04:00
CHECK (status IN ('init','setuprunning','setupcomplete','setupfailed','executorrunning','executorcomplete','executorfailed','paused')), note TEXT,
2025-06-19 12:06:08 -04:00
created_at TEXT NOT NULL DEFAULT (datetime('now', 'subsec')),
2025-06-17 15:22:47 -04:00
FOREIGN KEY (task_attempt_id) REFERENCES task_attempts(id) ON DELETE CASCADE
);