stringify reservation table status field
reason: no easy to setup enums support in diesel
This commit is contained in:
parent
d93992a3d1
commit
e4051479d4
@ -0,0 +1,2 @@
|
|||||||
|
CREATE TYPE reservation_status AS ENUM ('booked', 'paid');
|
||||||
|
ALTER TABLE reservations ALTER COLUMN status TYPE reservation_status USING status::reservation_status;
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE reservations ALTER COLUMN status TYPE VARCHAR;
|
||||||
|
DROP TYPE reservation_status;
|
||||||
@ -1,11 +1,5 @@
|
|||||||
// @generated automatically by Diesel CLI.
|
// @generated automatically by Diesel CLI.
|
||||||
|
|
||||||
pub mod sql_types {
|
|
||||||
#[derive(diesel::query_builder::QueryId, Clone, diesel::sql_types::SqlType)]
|
|
||||||
#[diesel(postgres_type(name = "reservation_status"))]
|
|
||||||
pub struct ReservationStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
diesel::table! {
|
diesel::table! {
|
||||||
events (id) {
|
events (id) {
|
||||||
id -> Int4,
|
id -> Int4,
|
||||||
@ -33,9 +27,6 @@ diesel::table! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
diesel::table! {
|
diesel::table! {
|
||||||
use diesel::sql_types::*;
|
|
||||||
use super::sql_types::ReservationStatus;
|
|
||||||
|
|
||||||
reservations (id) {
|
reservations (id) {
|
||||||
id -> Int4,
|
id -> Int4,
|
||||||
user_id -> Nullable<Int4>,
|
user_id -> Nullable<Int4>,
|
||||||
@ -43,7 +34,7 @@ diesel::table! {
|
|||||||
entered_name -> Nullable<Varchar>,
|
entered_name -> Nullable<Varchar>,
|
||||||
booked_time -> Timestamp,
|
booked_time -> Timestamp,
|
||||||
event_id -> Nullable<Int4>,
|
event_id -> Nullable<Int4>,
|
||||||
status -> ReservationStatus,
|
status -> Varchar,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user