Cleaned up things I decided to not use

This commit is contained in:
2019-10-22 19:06:21 +02:00
parent 461cebe009
commit bff5c60a4e
11 changed files with 33 additions and 1060 deletions

View File

@@ -1 +0,0 @@
DROP TYPE task_schedule;

View File

@@ -1 +0,0 @@
CREATE TYPE task_schedule AS ENUM('once', 'daily', 'weekly', 'monthly', 'yearly');

View File

@@ -3,12 +3,9 @@ CREATE TABLE tasks (
owner integer NOT NULL REFERENCES users(id),
name text NOT NULL,
notes text,
schedule task_schedule NOT NULL DEFAULT 'daily',
min_frequency integer,
max_frequency integer,
schedule jsonb NOT NULL DEFAULT '{}',
created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHECK(min_frequency IS NULL OR max_frequency IS NULL OR max_frequency > min_frequency)
updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TRIGGER set_tasks_updated BEFORE UPDATE ON tasks FOR EACH ROW EXECUTE PROCEDURE set_updated_timestamp();

View File

@@ -1,6 +1,6 @@
CREATE TABLE "sessions" (
"sid" text NOT NULL COLLATE "default",
"session" json NOT NULL,
"session" jsonb NOT NULL,
"expires_at" timestamptz NOT NULL,
"created_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP