diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-10-29 15:33:39 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-11-03 15:58:55 +0100 |
commit | 19ac840760f7f0d703cc50da8b3b0fdd88d5913f (patch) | |
tree | 7b93c74940a33fba1f441b191d7ce0a7042fa176 /migrations/2020-10-29-143003_create_submit_envs | |
parent | 5ef71187792cb05c2834f8ff104b1ebd0c5c00b0 (diff) |
Add migrations for creating all tables
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'migrations/2020-10-29-143003_create_submit_envs')
-rw-r--r-- | migrations/2020-10-29-143003_create_submit_envs/down.sql | 1 | ||||
-rw-r--r-- | migrations/2020-10-29-143003_create_submit_envs/up.sql | 8 |
2 files changed, 9 insertions, 0 deletions
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) +) |