Creates projects to organize tasks under. (Note the migration also contains the tables for creating folders for projects as well because adding foreign keys is a PITA in sqlite apparently). Reviewed-on: #19 Co-authored-by: Drew Galbraith <drew@tiramisu.one> Co-committed-by: Drew Galbraith <drew@tiramisu.one>
17 lines
550 B
SQL
17 lines
550 B
SQL
ALTER TABLE tasks RENAME TO tasks_old;
|
|
|
|
CREATE TABLE tasks (
|
|
id UUID PRIMARY KEY NOT NULL,
|
|
title VARCHAR NOT NULL,
|
|
description TEXT,
|
|
status TEXT CHECK(status IN ('todo', 'done', 'backlog')) DEFAULT 'todo',
|
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
completed_at TIMESTAMP
|
|
);
|
|
|
|
INSERT INTO tasks SELECT id, title, description, status, created_at, updated_at, completed_at FROM tasks_old;
|
|
|
|
DROP TABLE tasks_old;
|
|
DROP TABLE projects;
|
|
DROP TABLE folders;
|