admin panel have more control over payment now
This commit is contained in:
@@ -51,6 +51,7 @@ mod m20260623_000003_drop_currency;
|
||||
mod m20260623_000004_currencies;
|
||||
mod m20260625_000001_add_avatar_to_users;
|
||||
mod m20260627_000001_order_residence_address;
|
||||
mod m20260627_000002_payment_settings;
|
||||
pub struct Migrator;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
@@ -106,6 +107,7 @@ impl MigratorTrait for Migrator {
|
||||
Box::new(m20260623_000004_currencies::Migration),
|
||||
Box::new(m20260625_000001_add_avatar_to_users::Migration),
|
||||
Box::new(m20260627_000001_order_residence_address::Migration),
|
||||
Box::new(m20260627_000002_payment_settings::Migration),
|
||||
// inject-above (do not remove this comment)
|
||||
]
|
||||
}
|
||||
|
||||
41
migration/src/m20260627_000002_payment_settings.rs
Normal file
41
migration/src/m20260627_000002_payment_settings.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
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,
|
||||
"payment_methods",
|
||||
&[
|
||||
("id", ColType::PkAuto),
|
||||
("code", ColType::StringUniq),
|
||||
("name", ColType::String),
|
||||
("enabled", ColType::BooleanWithDefault(true)),
|
||||
("position", ColType::IntegerWithDefault(0)),
|
||||
],
|
||||
&[],
|
||||
)
|
||||
.await?;
|
||||
|
||||
create_table(
|
||||
m,
|
||||
"shop_settings",
|
||||
&[
|
||||
("id", ColType::PkAuto),
|
||||
("key", ColType::StringUniq),
|
||||
("value", ColType::TextNull),
|
||||
],
|
||||
&[],
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
||||
drop_table(m, "shop_settings").await?;
|
||||
drop_table(m, "payment_methods").await
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user