From 57cd5bdbe00eb3bacbd37e00077184c7a7928299 Mon Sep 17 00:00:00 2001 From: simonsan <14062932+simonsan@users.noreply.github.com> Date: Sun, 24 Mar 2024 21:24:39 +0100 Subject: [PATCH] add initial migration Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com> --- .../2024-03-24-201233_create_activities/down.sql | 2 ++ .../2024-03-24-201233_create_activities/up.sql | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 migrations/2024-03-24-201233_create_activities/down.sql create mode 100644 migrations/2024-03-24-201233_create_activities/up.sql diff --git a/migrations/2024-03-24-201233_create_activities/down.sql b/migrations/2024-03-24-201233_create_activities/down.sql new file mode 100644 index 00000000..9d102141 --- /dev/null +++ b/migrations/2024-03-24-201233_create_activities/down.sql @@ -0,0 +1,2 @@ +-- This file should undo anything in `up.sql` +DROP TABLE activities; \ No newline at end of file diff --git a/migrations/2024-03-24-201233_create_activities/up.sql b/migrations/2024-03-24-201233_create_activities/up.sql new file mode 100644 index 00000000..44e985ce --- /dev/null +++ b/migrations/2024-03-24-201233_create_activities/up.sql @@ -0,0 +1,14 @@ +-- Migration script for creating the activities table in SQLite + +CREATE TABLE activities ( + id TEXT PRIMARY KEY, + category TEXT NOT NULL, + description TEXT NOT NULL, + begin TEXT NOT NULL, + end TEXT NOT NULL, + duration INTEGER NOT NULL, + kind TEXT NOT NULL, + status TEXT NOT NULL, + parent_id INTEGER, + FOREIGN KEY (parent_id) REFERENCES activities(id) +);