tenis booking site done by claude

This commit is contained in:
Priec
2026-05-16 00:02:39 +02:00
parent 8b7f883f14
commit 7d05209d48
40 changed files with 1180 additions and 632 deletions

View File

@@ -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)
]
}

View 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
}
}