Rustfmt
This commit is contained in:
@@ -6,54 +6,40 @@ pub struct Migration;
|
||||
#[async_trait::async_trait]
|
||||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.create_table(
|
||||
Table::create()
|
||||
.table(Transaction::Table)
|
||||
.if_not_exists()
|
||||
.col(
|
||||
ColumnDef::new(Transaction::Id)
|
||||
.string()
|
||||
.not_null()
|
||||
.primary_key(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::TransactionType)
|
||||
.string()
|
||||
.not_null(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::TotalAmount)
|
||||
.decimal()
|
||||
.not_null(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::Timestamp)
|
||||
.timestamp()
|
||||
.not_null(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::Title)
|
||||
.string()
|
||||
.not_null(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::Emoji)
|
||||
.string(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::Notes)
|
||||
.string(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::Receipt)
|
||||
.string(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::Description)
|
||||
.string(),
|
||||
)
|
||||
.to_owned()
|
||||
).await?;
|
||||
manager
|
||||
.create_table(
|
||||
Table::create()
|
||||
.table(Transaction::Table)
|
||||
.if_not_exists()
|
||||
.col(
|
||||
ColumnDef::new(Transaction::Id)
|
||||
.string()
|
||||
.not_null()
|
||||
.primary_key(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::TransactionType)
|
||||
.string()
|
||||
.not_null(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::TotalAmount)
|
||||
.decimal()
|
||||
.not_null(),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Transaction::Timestamp)
|
||||
.timestamp()
|
||||
.not_null(),
|
||||
)
|
||||
.col(ColumnDef::new(Transaction::Title).string().not_null())
|
||||
.col(ColumnDef::new(Transaction::Emoji).string())
|
||||
.col(ColumnDef::new(Transaction::Notes).string())
|
||||
.col(ColumnDef::new(Transaction::Receipt).string())
|
||||
.col(ColumnDef::new(Transaction::Description).string())
|
||||
.to_owned(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
manager
|
||||
.create_table(
|
||||
@@ -73,7 +59,8 @@ impl MigrationTrait for Migration {
|
||||
)
|
||||
.col(ColumnDef::new(Expenditure::Amount).decimal().not_null())
|
||||
.to_owned(),
|
||||
).await?;
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user