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;
