tenis booking site done by claude
This commit is contained in:
@@ -4,6 +4,7 @@ pub use sea_orm_migration::prelude::*;
|
||||
mod m20220101_000001_users;
|
||||
|
||||
mod m20260515_162423_courts;
|
||||
mod m20260515_170417_bookings;
|
||||
pub struct Migrator;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
@@ -12,6 +13,7 @@ impl MigratorTrait for Migrator {
|
||||
vec![
|
||||
Box::new(m20220101_000001_users::Migration),
|
||||
Box::new(m20260515_162423_courts::Migration),
|
||||
Box::new(m20260515_170417_bookings::Migration),
|
||||
// inject-above (do not remove this comment)
|
||||
]
|
||||
}
|
||||
|
||||
31
ht_booking/migration/src/m20260515_170417_bookings.rs
Normal file
31
ht_booking/migration/src/m20260515_170417_bookings.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
use loco_rs::schema::*;
|
||||
use sea_orm_migration::prelude::*;
|
||||
|
||||
#[derive(DeriveMigrationName)]
|
||||
pub struct Migration;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
||||
create_table(m, "bookings",
|
||||
&[
|
||||
|
||||
("id", ColType::PkAuto),
|
||||
|
||||
("date", ColType::Date),
|
||||
("hour", ColType::Integer),
|
||||
("color", ColType::String),
|
||||
("name", ColType::String),
|
||||
("contact", ColType::StringNull),
|
||||
("note", ColType::TextNull),
|
||||
],
|
||||
&[
|
||||
("court", ""),
|
||||
]
|
||||
).await
|
||||
}
|
||||
|
||||
async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
||||
drop_table(m, "bookings").await
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user