fix: make all reservation fields required

This commit is contained in:
Akulij 2025-04-08 00:00:01 +09:00
parent dda5fd5a93
commit 9ac297cf5a
4 changed files with 12 additions and 4 deletions

View File

@ -0,0 +1,4 @@
ALTER TABLE reservations
ALTER COLUMN user_id DROP NOT NULL,
ALTER COLUMN entered_name DROP NOT NULL,
ALTER COLUMN event_id DROP NOT NULL;

View File

@ -0,0 +1,4 @@
ALTER TABLE reservations
ALTER COLUMN user_id SET NOT NULL,
ALTER COLUMN entered_name SET NOT NULL,
ALTER COLUMN event_id SET NOT NULL;

View File

@ -34,7 +34,7 @@ pub struct Message {
#[diesel(table_name = reservations)] #[diesel(table_name = reservations)]
pub struct Reservation { pub struct Reservation {
pub id: i32, pub id: i32,
pub user_id: Option<i32>, pub user_id: Option<i64>,
pub entered_name: Option<String>, pub entered_name: Option<String>,
pub booked_time: NaiveDateTime, pub booked_time: NaiveDateTime,
pub event_id: Option<i32>, pub event_id: Option<i32>,

View File

@ -29,11 +29,11 @@ diesel::table! {
diesel::table! { diesel::table! {
reservations (id) { reservations (id) {
id -> Int4, id -> Int4,
user_id -> Nullable<Int4>, user_id -> Int8,
#[max_length = 255] #[max_length = 255]
entered_name -> Nullable<Varchar>, entered_name -> Varchar,
booked_time -> Timestamp, booked_time -> Timestamp,
event_id -> Nullable<Int4>, event_id -> Int4,
status -> Varchar, status -> Varchar,
} }
} }