summaryrefslogtreecommitdiffstats
path: root/migrations/2020-10-29-141023_create_submits
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-10-29 15:33:39 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-11-03 15:58:55 +0100
commit19ac840760f7f0d703cc50da8b3b0fdd88d5913f (patch)
tree7b93c74940a33fba1f441b191d7ce0a7042fa176 /migrations/2020-10-29-141023_create_submits
parent5ef71187792cb05c2834f8ff104b1ebd0c5c00b0 (diff)
Add migrations for creating all tables
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'migrations/2020-10-29-141023_create_submits')
-rw-r--r--migrations/2020-10-29-141023_create_submits/down.sql2
-rw-r--r--migrations/2020-10-29-141023_create_submits/up.sql13
2 files changed, 15 insertions, 0 deletions
diff --git a/migrations/2020-10-29-141023_create_submits/down.sql b/migrations/2020-10-29-141023_create_submits/down.sql
new file mode 100644
index 0000000..8d0c7f4
--- /dev/null
+++ b/migrations/2020-10-29-141023_create_submits/down.sql
@@ -0,0 +1,2 @@
+-- This file should undo anything in `up.sql`
+DROP TABLE submits
diff --git a/migrations/2020-10-29-141023_create_submits/up.sql b/migrations/2020-10-29-141023_create_submits/up.sql
new file mode 100644
index 0000000..ca1a8bb
--- /dev/null
+++ b/migrations/2020-10-29-141023_create_submits/up.sql
@@ -0,0 +1,13 @@
+-- Your SQL goes here
+CREATE TABLE submits (
+ id SERIAL PRIMARY KEY NOT NULL,
+ uuid UUID NOT NULL UNIQUE,
+ submit_time TIMESTAMP WITH TIME ZONE NOT NULL,
+
+ requested_image_id INTEGER REFERENCES images(id) NOT NULL,
+ requested_package_id INTEGER REFERENCES packages(id) NOT NULL,
+ repo_hash_id INTEGER REFERENCES githashes(id) NOT NULL,
+
+ tree JSONB NOT NULL,
+ buildplan JSONB NOT NULL
+)