dodacia adresa
This commit is contained in:
@@ -50,6 +50,7 @@ mod m20260623_000002_strip_html_from_product_search;
|
||||
mod m20260623_000003_drop_currency;
|
||||
mod m20260623_000004_currencies;
|
||||
mod m20260625_000001_add_avatar_to_users;
|
||||
mod m20260627_000001_order_residence_address;
|
||||
pub struct Migrator;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
@@ -104,7 +105,8 @@ impl MigratorTrait for Migrator {
|
||||
Box::new(m20260623_000003_drop_currency::Migration),
|
||||
Box::new(m20260623_000004_currencies::Migration),
|
||||
Box::new(m20260625_000001_add_avatar_to_users::Migration),
|
||||
Box::new(m20260627_000001_order_residence_address::Migration),
|
||||
// inject-above (do not remove this comment)
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
22
migration/src/m20260627_000001_order_residence_address.rs
Normal file
22
migration/src/m20260627_000001_order_residence_address.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
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> {
|
||||
add_column(m, "orders", "residence_address", ColType::StringNull).await?;
|
||||
add_column(m, "orders", "residence_city", ColType::StringNull).await?;
|
||||
add_column(m, "orders", "residence_zip", ColType::StringNull).await?;
|
||||
add_column(m, "orders", "residence_country", ColType::StringNull).await
|
||||
}
|
||||
|
||||
async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
||||
remove_column(m, "orders", "residence_country").await?;
|
||||
remove_column(m, "orders", "residence_zip").await?;
|
||||
remove_column(m, "orders", "residence_city").await?;
|
||||
remove_column(m, "orders", "residence_address").await
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user