Skip to content

Commit

Permalink
mysql: ColumnType::Money maps to decimal(M, N)
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Jan 31, 2024
1 parent cf93859 commit 0e14ed6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/backend/mysql/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ impl TableBuilder for MysqlQueryBuilder {
}
ColumnType::Boolean => "bool".into(),
ColumnType::Money(precision) => match precision {
Some((precision, scale)) => format!("money({precision}, {scale})"),
None => "money".into(),
Some((precision, scale)) => format!("decimal({precision}, {scale})"),
None => "decimal".into(),
},
ColumnType::Json => "json".into(),
ColumnType::JsonBinary => "json".into(),
Expand Down
2 changes: 1 addition & 1 deletion src/table/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub trait IntoColumnDef {
/// | Bit | bit | bit | N/A |
/// | VarBit | bit | varbit | N/A |
/// | Boolean | bool | bool | boolean |
/// | Money | money | money | real_money |
/// | Money | decimal | money | real_money |
/// | Json | json | json | json_text |
/// | JsonBinary | json | jsonb | jsonb_text |
/// | Uuid | binary(16) | uuid | uuid_text |
Expand Down

0 comments on commit 0e14ed6

Please sign in to comment.