summaryrefslogtreecommitdiffstats
path: root/migrations/2021-01-07-122618_dedicated-releases-table/up.sql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/2021-01-07-122618_dedicated-releases-table/up.sql')
-rw-r--r--migrations/2021-01-07-122618_dedicated-releases-table/up.sql13
1 files changed, 13 insertions, 0 deletions
diff --git a/migrations/2021-01-07-122618_dedicated-releases-table/up.sql b/migrations/2021-01-07-122618_dedicated-releases-table/up.sql
new file mode 100644
index 0000000..0fd2295
--- /dev/null
+++ b/migrations/2021-01-07-122618_dedicated-releases-table/up.sql
@@ -0,0 +1,13 @@
+-- Your SQL goes here
+ALTER TABLE
+ artifacts
+DROP COLUMN
+ released;
+
+CREATE TABLE releases (
+ id SERIAL PRIMARY KEY NOT NULL,
+ artifact_id INTEGER REFERENCES artifacts(id) NOT NULL,
+ release_date TIMESTAMP WITH TIME ZONE NOT NULL,
+
+ CONSTRAINT UC_art_release_unique UNIQUE (artifact_id, release_date)
+);