more webshop
This commit is contained in:
30
migration/src/m20260616_150755_shipping_methods.rs
Normal file
30
migration/src/m20260616_150755_shipping_methods.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
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, "shipping_methods",
|
||||
&[
|
||||
|
||||
("id", ColType::PkAuto),
|
||||
|
||||
("code", ColType::StringUniq),
|
||||
("name", ColType::String),
|
||||
("price_cents", ColType::BigIntegerWithDefault(0)),
|
||||
("requires_pickup_point", ColType::BooleanWithDefault(false)),
|
||||
("enabled", ColType::BooleanWithDefault(true)),
|
||||
("position", ColType::IntegerWithDefault(0)),
|
||||
],
|
||||
&[
|
||||
]
|
||||
).await
|
||||
}
|
||||
|
||||
async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
||||
drop_table(m, "shipping_methods").await
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user