From 5e759d4ed6ce9f4443e3a12cb98ddb5201ccf259 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Fri, 18 Jun 2021 19:53:42 -0400 Subject: [PATCH] add linux/unix distribution template table Signed-off-by: Christine Dodrill --- migrations/2021-06-18-234254_templates/down.sql | 1 + migrations/2021-06-18-234254_templates/up.sql | 9 +++++++++ src/schema.rs | 13 +++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 migrations/2021-06-18-234254_templates/down.sql create mode 100644 migrations/2021-06-18-234254_templates/up.sql diff --git a/migrations/2021-06-18-234254_templates/down.sql b/migrations/2021-06-18-234254_templates/down.sql new file mode 100644 index 0000000..39e152d --- /dev/null +++ b/migrations/2021-06-18-234254_templates/down.sql @@ -0,0 +1 @@ +DROP TABLE templates; diff --git a/migrations/2021-06-18-234254_templates/up.sql b/migrations/2021-06-18-234254_templates/up.sql new file mode 100644 index 0000000..3d622f0 --- /dev/null +++ b/migrations/2021-06-18-234254_templates/up.sql @@ -0,0 +1,9 @@ +CREATE TABLE IF NOT EXISTS templates + ( uuid TEXT UNIQUE NOT NULL PRIMARY KEY + , "name" TEXT UNIQUE NOT NULL + , distro TEXT NOT NULL + , version TEXT NOT NULL + , download_url TEXT NOT NULL + , sha256sum TEXT NOT NULL + , local_url TEXT NOT NULL + ); diff --git a/src/schema.rs b/src/schema.rs index 187548a..d7441c5 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -18,9 +18,22 @@ table! { } } +table! { + templates (uuid) { + uuid -> Text, + name -> Text, + distro -> Text, + version -> Text, + download_url -> Text, + sha256sum -> Text, + local_url -> Text, + } +} + joinable!(instances -> connections (owner)); allow_tables_to_appear_in_same_query!( connections, instances, + templates, );