From 82ba28f1976305c1163adb5993745604ccb696cc Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 27 Jul 2020 20:45:20 +0100 Subject: chore: Move //fun/tvldb -> //fun/paroxysm Say ~my~ its name! Change-Id: I7890318aef984af0f6bc011de32282f16e01cbb3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1483 Tested-by: BuildkiteCI Reviewed-by: eta --- fun/paroxysm/migrations/20181209140247_initial/down.sql | 2 ++ fun/paroxysm/migrations/20181209140247_initial/up.sql | 15 +++++++++++++++ .../migrations/20181218142013_fix_unique/down.sql | 1 + fun/paroxysm/migrations/20181218142013_fix_unique/up.sql | 1 + 4 files changed, 19 insertions(+) create mode 100644 fun/paroxysm/migrations/20181209140247_initial/down.sql create mode 100644 fun/paroxysm/migrations/20181209140247_initial/up.sql create mode 100644 fun/paroxysm/migrations/20181218142013_fix_unique/down.sql create mode 100644 fun/paroxysm/migrations/20181218142013_fix_unique/up.sql (limited to 'fun/paroxysm/migrations') diff --git a/fun/paroxysm/migrations/20181209140247_initial/down.sql b/fun/paroxysm/migrations/20181209140247_initial/down.sql new file mode 100644 index 0000000000..aa02f4f63f --- /dev/null +++ b/fun/paroxysm/migrations/20181209140247_initial/down.sql @@ -0,0 +1,2 @@ +DROP TABLE entries; +DROP TABLE keywords; diff --git a/fun/paroxysm/migrations/20181209140247_initial/up.sql b/fun/paroxysm/migrations/20181209140247_initial/up.sql new file mode 100644 index 0000000000..e8b52d5a9b --- /dev/null +++ b/fun/paroxysm/migrations/20181209140247_initial/up.sql @@ -0,0 +1,15 @@ +CREATE TABLE keywords ( + id SERIAL PRIMARY KEY, + name VARCHAR UNIQUE NOT NULL, + chan VARCHAR NOT NULL, + UNIQUE(name, chan) +); + +CREATE TABLE entries ( + id SERIAL PRIMARY KEY, + keyword_id INT NOT NULL REFERENCES keywords ON DELETE CASCADE, + idx INT NOT NULL, + text VARCHAR NOT NULL, + creation_ts TIMESTAMP NOT NULL, + created_by VARCHAR NOT NULL +); diff --git a/fun/paroxysm/migrations/20181218142013_fix_unique/down.sql b/fun/paroxysm/migrations/20181218142013_fix_unique/down.sql new file mode 100644 index 0000000000..291a97c5ce --- /dev/null +++ b/fun/paroxysm/migrations/20181218142013_fix_unique/down.sql @@ -0,0 +1 @@ +-- This file should undo anything in `up.sql` \ No newline at end of file diff --git a/fun/paroxysm/migrations/20181218142013_fix_unique/up.sql b/fun/paroxysm/migrations/20181218142013_fix_unique/up.sql new file mode 100644 index 0000000000..4885ae5ede --- /dev/null +++ b/fun/paroxysm/migrations/20181218142013_fix_unique/up.sql @@ -0,0 +1 @@ +ALTER TABLE keywords DROP CONSTRAINT IF EXISTS keywords_name_key; -- cgit 1.4.1