more webshop

This commit is contained in:
Priec
2026-06-16 19:27:29 +02:00
parent baf7522273
commit f0a6f97609
25 changed files with 583 additions and 33 deletions

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