Skip to content

Commit

Permalink
mod: decimal values
Browse files Browse the repository at this point in the history
  • Loading branch information
bennjii committed Nov 13, 2023
1 parent 9249458 commit 1b47b38
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/migrator/m20230730_000002_customer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Customer::TenantId).string().not_null())
.col(ColumnDef::new(Customer::Contact).json().not_null())
.col(ColumnDef::new(Customer::CustomerNotes).json().not_null())
.col(ColumnDef::new(Customer::Balance).float().not_null())
.col(
ColumnDef::new(Customer::Balance)
.decimal_len(24, 8)
.not_null(),
)
.col(ColumnDef::new(Customer::SpecialPricing).json().not_null())
.col(
ColumnDef::new(Customer::AcceptsMarketing)
Expand Down
18 changes: 15 additions & 3 deletions src/migrator/m20230730_000003_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ impl MigrationTrait for Migration {
.not_null(),
)
.col(ColumnDef::new(Transactions::Products).json().not_null())
.col(ColumnDef::new(Transactions::OrderTotal).float().not_null())
.col(
ColumnDef::new(Transactions::OrderTotal)
.decimal_len(24, 8)
.not_null(),
)
.col(ColumnDef::new(Transactions::Payment).json().not_null())
.col(
ColumnDef::new(Transactions::OrderDate)
Expand All @@ -41,8 +45,16 @@ impl MigrationTrait for Migration {
.col(ColumnDef::new(Transactions::OrderNotes).json().not_null())
.col(ColumnDef::new(Transactions::Salesperson).text().not_null())
.col(ColumnDef::new(Transactions::Kiosk).text().not_null())
.col(ColumnDef::new(Transactions::CreatedAt).date_time().not_null())
.col(ColumnDef::new(Transactions::UpdatedAt).date_time().not_null())
.col(
ColumnDef::new(Transactions::CreatedAt)
.date_time()
.not_null(),
)
.col(
ColumnDef::new(Transactions::UpdatedAt)
.date_time()
.not_null(),
)
.to_owned(),
)
.await
Expand Down

0 comments on commit 1b47b38

Please sign in to comment.