phone number + country

This commit is contained in:
Priec
2026-06-17 18:02:46 +02:00
parent cd7a756a54
commit d18bdeaf6e
13 changed files with 96 additions and 6 deletions

View File

@@ -29,6 +29,7 @@ mod m20260616_150812_add_shipping_fields_to_orders;
mod m20260616_160000_add_parent_to_categories;
mod m20260617_000001_add_carrier_to_shipping_methods;
mod m20260617_000002_add_shipment_to_orders;
mod m20260617_000003_add_phone_to_orders;
pub struct Migrator;
#[async_trait::async_trait]
@@ -62,6 +63,7 @@ impl MigratorTrait for Migrator {
Box::new(m20260616_160000_add_parent_to_categories::Migration),
Box::new(m20260617_000001_add_carrier_to_shipping_methods::Migration),
Box::new(m20260617_000002_add_shipment_to_orders::Migration),
Box::new(m20260617_000003_add_phone_to_orders::Migration),
// inject-above (do not remove this comment)
]
}

View File

@@ -0,0 +1,17 @@
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> {
// Customer contact phone, also passed to carriers for pickup SMS.
add_column(m, "orders", "phone", ColType::StringNull).await
}
async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
remove_column(m, "orders", "phone").await
}
}