From 19ac840760f7f0d703cc50da8b3b0fdd88d5913f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 29 Oct 2020 15:33:39 +0100 Subject: Add migrations for creating all tables Signed-off-by: Matthias Beyer --- migrations/2020-10-29-143003_create_submit_envs/down.sql | 1 + migrations/2020-10-29-143003_create_submit_envs/up.sql | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 migrations/2020-10-29-143003_create_submit_envs/down.sql create mode 100644 migrations/2020-10-29-143003_create_submit_envs/up.sql (limited to 'migrations/2020-10-29-143003_create_submit_envs') diff --git a/migrations/2020-10-29-143003_create_submit_envs/down.sql b/migrations/2020-10-29-143003_create_submit_envs/down.sql new file mode 100644 index 0000000..291a97c --- /dev/null +++ b/migrations/2020-10-29-143003_create_submit_envs/down.sql @@ -0,0 +1 @@ +-- This file should undo anything in `up.sql` \ No newline at end of file diff --git a/migrations/2020-10-29-143003_create_submit_envs/up.sql b/migrations/2020-10-29-143003_create_submit_envs/up.sql new file mode 100644 index 0000000..1be7c2e --- /dev/null +++ b/migrations/2020-10-29-143003_create_submit_envs/up.sql @@ -0,0 +1,8 @@ +-- Your SQL goes here +CREATE TABLE submit_envs ( + id SERIAL PRIMARY KEY NOT NULL, + submit_id INTEGER REFERENCES submits(id) NOT NULL, + env_id INTEGER REFERENCES envvars(id) NOT NULL, + + CONSTRAINT UC_submitid_envid UNIQUE (submit_id, env_id) +) -- cgit v1.2.3