Cleanups
This commit is contained in:
parent
894e8b40a4
commit
b9c017b1fa
@ -38,7 +38,8 @@ impl MigrationTrait for Migration {
|
||||
PaymentCollectionSession::PaymentSessionId,
|
||||
))
|
||||
.to_owned(),
|
||||
);
|
||||
)
|
||||
.await?;
|
||||
|
||||
m.drop_index(
|
||||
IndexDropStatement::new()
|
||||
@ -49,7 +50,8 @@ impl MigrationTrait for Migration {
|
||||
PaymentCollectionPayment::PaymentId,
|
||||
))
|
||||
.to_owned(),
|
||||
);
|
||||
)
|
||||
.await?;
|
||||
|
||||
self.drop_table(m, PaymentCollectionSession::PaymentCollectionSessions)
|
||||
.await?;
|
||||
@ -444,7 +446,8 @@ impl Migration {
|
||||
PaymentCollectionPayment::PaymentId,
|
||||
))
|
||||
.to_owned(),
|
||||
);
|
||||
)
|
||||
.await?;
|
||||
|
||||
m.create_foreign_key(
|
||||
ForeignKeyCreateStatement::new()
|
||||
@ -460,7 +463,8 @@ impl Migration {
|
||||
PaymentCollection::Id,
|
||||
))
|
||||
.to_owned(),
|
||||
);
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
use sea_orm_migration::prelude::*;
|
||||
|
||||
use crate::constraint::Check;
|
||||
use crate::sea_orm::Iterable;
|
||||
use crate::{
|
||||
auto_uuid_not_null, create_constraint, create_type, drop_type, to_fk_name, to_pk2_name,
|
||||
ts_def_now_not_null, AsIden, DropTable, IntoColumnDef,
|
||||
ts_def_now_not_null, AsIden,
|
||||
};
|
||||
|
||||
#[derive(DeriveMigrationName)]
|
||||
|
@ -1,9 +1,6 @@
|
||||
use sea_orm_migration::prelude::*;
|
||||
|
||||
use crate::sea_orm::Iterable;
|
||||
use crate::{
|
||||
auto_uuid_not_null, create_type, drop_type, ts_def_now_not_null, DropTable, IntoColumnDef,
|
||||
};
|
||||
use crate::{auto_uuid_not_null, ts_def_now_not_null, IntoColumnDef};
|
||||
|
||||
#[derive(DeriveMigrationName)]
|
||||
pub struct Migration;
|
||||
@ -17,6 +14,15 @@ impl MigrationTrait for Migration {
|
||||
}
|
||||
|
||||
async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
||||
m.drop_table(Table::drop().table(GiftCard::GiftCards).to_owned())
|
||||
.await?;
|
||||
m.drop_table(
|
||||
Table::drop()
|
||||
.table(GiftCardTransaction::GiftCardTransactions)
|
||||
.to_owned(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use std::fmt::{Display, Formatter, Pointer};
|
||||
use std::fmt::{Display, Formatter};
|
||||
|
||||
pub use sea_orm_migration::prelude::*;
|
||||
|
||||
@ -115,7 +115,7 @@ fn to_snake(s: String) -> String {
|
||||
}
|
||||
|
||||
pub mod constraint {
|
||||
use std::fmt::{Display, Formatter, Write};
|
||||
use std::fmt::{Display, Formatter};
|
||||
|
||||
use crate::{Constraint, Iden};
|
||||
|
||||
@ -195,7 +195,7 @@ pub struct CheckUSize(usize);
|
||||
|
||||
impl Iden for CheckUSize {
|
||||
fn unquoted(&self, s: &mut dyn Write) {
|
||||
s.write_str(&format!("{}", self.0));
|
||||
s.write_str(&format!("{}", self.0)).ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,6 +248,6 @@ async fn create_constraint<T: Iden, C: Into<Constraint>>(
|
||||
c.to_name(),
|
||||
c
|
||||
))
|
||||
.await;
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user