chore: reorganize project into monorepo
This commit is contained in:
32
backend/migration/src/m20260327_061300_reviews.rs
Normal file
32
backend/migration/src/m20260327_061300_reviews.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
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,
|
||||
"reviews",
|
||||
&[
|
||||
("id", ColType::PkAuto),
|
||||
("title", ColType::StringNull),
|
||||
("review_type", ColType::StringNull),
|
||||
("rating", ColType::IntegerNull),
|
||||
("review_date", ColType::StringNull),
|
||||
("status", ColType::StringNull),
|
||||
("description", ColType::StringNull),
|
||||
("tags", ColType::StringNull),
|
||||
("cover", ColType::StringNull),
|
||||
],
|
||||
&[],
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
||||
drop_table(m, "reviews").await
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user