From 2afe17f1c0981d03dca09f73bd18251ed2c9adb3 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Tue, 14 Nov 2023 21:55:18 -0800 Subject: [PATCH] add estimated_end to show data --- migrations/2023-11-04-093417_create_shows/up.sql | 1 + src/lib/models.rs | 1 + src/lib/schema.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/migrations/2023-11-04-093417_create_shows/up.sql b/migrations/2023-11-04-093417_create_shows/up.sql index 63dee6c..1f14672 100644 --- a/migrations/2023-11-04-093417_create_shows/up.sql +++ b/migrations/2023-11-04-093417_create_shows/up.sql @@ -4,6 +4,7 @@ CREATE TABLE id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, dancer INT UNSIGNED NOT NULL, start DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, + estimated_end DATETIME NOT NULL, end DATETIME DEFAULT NULL, FOREIGN KEY (dancer) REFERENCES dancers (id) ON DELETE RESTRICT ) diff --git a/src/lib/models.rs b/src/lib/models.rs index f306326..54dcc61 100644 --- a/src/lib/models.rs +++ b/src/lib/models.rs @@ -56,5 +56,6 @@ pub struct Show { pub id: u32, pub dancer: u32, pub start: chrono::NaiveDateTime, + pub estimated_end: chrono::NaiveDateTime, pub end: Option, } diff --git a/src/lib/schema.rs b/src/lib/schema.rs index fd547f1..68ec100 100644 --- a/src/lib/schema.rs +++ b/src/lib/schema.rs @@ -31,6 +31,7 @@ diesel::table! { id -> Unsigned, dancer -> Unsigned, start -> Datetime, + estimated_end -> Datetime, end -> Nullable, } }