From ba218f4688a085d5b909725fe53032bc5baca75a Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Tue, 8 Aug 2023 11:49:34 +0300 Subject: [PATCH] Add migration to create job queue. --- .../down.sql | 1 + .../2023-08-08-084449_create_job_queue/up.sql | 4 +++ backend/rvoc-backend/src/schema.rs | 27 ++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 backend/rvoc-backend/migrations/2023-08-08-084449_create_job_queue/down.sql create mode 100644 backend/rvoc-backend/migrations/2023-08-08-084449_create_job_queue/up.sql diff --git a/backend/rvoc-backend/migrations/2023-08-08-084449_create_job_queue/down.sql b/backend/rvoc-backend/migrations/2023-08-08-084449_create_job_queue/down.sql new file mode 100644 index 0000000..ef91ee7 --- /dev/null +++ b/backend/rvoc-backend/migrations/2023-08-08-084449_create_job_queue/down.sql @@ -0,0 +1 @@ +DROP TABLE job_queue; diff --git a/backend/rvoc-backend/migrations/2023-08-08-084449_create_job_queue/up.sql b/backend/rvoc-backend/migrations/2023-08-08-084449_create_job_queue/up.sql new file mode 100644 index 0000000..aceef1b --- /dev/null +++ b/backend/rvoc-backend/migrations/2023-08-08-084449_create_job_queue/up.sql @@ -0,0 +1,4 @@ +CREATE TABLE job_queue ( + scheduled_execution_time TIMESTAMP PRIMARY KEY, + name TEXT NOT NULL +); diff --git a/backend/rvoc-backend/src/schema.rs b/backend/rvoc-backend/src/schema.rs index 11eeb2a..90b3a99 100644 --- a/backend/rvoc-backend/src/schema.rs +++ b/backend/rvoc-backend/src/schema.rs @@ -1,5 +1,25 @@ // @generated automatically by Diesel CLI. +diesel::table! { + /// Representation of the `job_queue` table. + /// + /// (Automatically generated by Diesel.) + job_queue (scheduled_execution_time) { + /// The `scheduled_execution_time` column of the `job_queue` table. + /// + /// Its SQL type is `Timestamp`. + /// + /// (Automatically generated by Diesel.) + scheduled_execution_time -> Timestamp, + /// The `name` column of the `job_queue` table. + /// + /// Its SQL type is `Text`. + /// + /// (Automatically generated by Diesel.) + name -> Text, + } +} + diesel::table! { /// Representation of the `languages` table. /// @@ -69,4 +89,9 @@ diesel::table! { diesel::joinable!(words -> languages (language)); diesel::joinable!(words -> word_types (word_type)); -diesel::allow_tables_to_appear_in_same_query!(languages, word_types, words,); +diesel::allow_tables_to_appear_in_same_query!( + job_queue, + languages, + word_types, + words, +);