mirror of
https://github.com/grocy/grocy.git
synced 2025-10-12 16:44:55 +00:00
Start working on tasks feature
This commit is contained in:
24
migrations/0036.sql
Normal file
24
migrations/0036.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
CREATE TABLE tasks (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
|
||||
name TEXT NOT NULL UNIQUE,
|
||||
description TEXT,
|
||||
due DATETIME,
|
||||
started TINYINT NOT NULL DEFAULT 0 CHECK(started IN (0, 1)),
|
||||
done TINYINT NOT NULL DEFAULT 0 CHECK(done IN (0, 1)),
|
||||
category_id INTEGER,
|
||||
row_created_timestamp DATETIME DEFAULT (datetime('now', 'localtime'))
|
||||
);
|
||||
|
||||
CREATE TABLE task_categories (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
|
||||
name TEXT NOT NULL UNIQUE,
|
||||
description TEXT,
|
||||
row_created_timestamp DATETIME DEFAULT (datetime('now', 'localtime'))
|
||||
);
|
||||
|
||||
CREATE VIEW tasks_current
|
||||
AS
|
||||
SELECT *
|
||||
FROM tasks
|
||||
WHERE due IS NULL
|
||||
OR (due IS NOT NULL AND due > datetime('now', 'localtime'));
|
Reference in New Issue
Block a user