summaryrefslogtreecommitdiffstats
path: root/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'migrations')
-rw-r--r--migrations/2020-12-14-100454_artifact-unique-by-job/down.sql5
-rw-r--r--migrations/2020-12-14-100454_artifact-unique-by-job/up.sql6
-rw-r--r--migrations/2020-12-14-113756_artifact_not_unique_by_path/down.sql7
-rw-r--r--migrations/2020-12-14-113756_artifact_not_unique_by_path/up.sql5
4 files changed, 23 insertions, 0 deletions
diff --git a/migrations/2020-12-14-100454_artifact-unique-by-job/down.sql b/migrations/2020-12-14-100454_artifact-unique-by-job/down.sql
new file mode 100644
index 0000000..11de887
--- /dev/null
+++ b/migrations/2020-12-14-100454_artifact-unique-by-job/down.sql
@@ -0,0 +1,5 @@
+-- This file should undo anything in `up.sql`
+ALTER TABLE
+ artifacts
+DROP CONSTRAINT
+ path_job_id_unique
diff --git a/migrations/2020-12-14-100454_artifact-unique-by-job/up.sql b/migrations/2020-12-14-100454_artifact-unique-by-job/up.sql
new file mode 100644
index 0000000..3749514
--- /dev/null
+++ b/migrations/2020-12-14-100454_artifact-unique-by-job/up.sql
@@ -0,0 +1,6 @@
+-- Your SQL goes here
+ALTER TABLE
+ artifacts
+ADD CONSTRAINT
+ path_job_id_unique
+ UNIQUE (path, job_id)
diff --git a/migrations/2020-12-14-113756_artifact_not_unique_by_path/down.sql b/migrations/2020-12-14-113756_artifact_not_unique_by_path/down.sql
new file mode 100644
index 0000000..c8bfe9d
--- /dev/null
+++ b/migrations/2020-12-14-113756_artifact_not_unique_by_path/down.sql
@@ -0,0 +1,7 @@
+-- This file should undo anything in `up.sql`
+ALTER TABLE
+ artifacts
+ADD CONSTRAINT
+ artifacts_path_key -- as generated by default for postgresql
+ UNIQUE (path)
+
diff --git a/migrations/2020-12-14-113756_artifact_not_unique_by_path/up.sql b/migrations/2020-12-14-113756_artifact_not_unique_by_path/up.sql
new file mode 100644
index 0000000..0dee2b4
--- /dev/null
+++ b/migrations/2020-12-14-113756_artifact_not_unique_by_path/up.sql
@@ -0,0 +1,5 @@
+-- Your SQL goes here
+ALTER TABLE
+ artifacts
+DROP CONSTRAINT
+ artifacts_path_key -- as generated by default for postgresql