mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-03 15:55:45 +00:00
fix(mariadb): don't append UNSIGNED to the type of timestamp columns
This commit is contained in:
parent
1dac0b5c29
commit
475ed9e1df
@ -52,7 +52,11 @@ impl Display for MySqlTypeInfo {
|
|||||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||||
f.write_str(self.r#type.name(self.char_set))?;
|
f.write_str(self.r#type.name(self.char_set))?;
|
||||||
|
|
||||||
if self.flags.contains(ColumnFlags::UNSIGNED) {
|
// NOTE: MariaDB flags timestamp columns as UNSIGNED but the type name
|
||||||
|
// does not have that suffix
|
||||||
|
if self.flags.contains(ColumnFlags::UNSIGNED)
|
||||||
|
&& !self.flags.contains(ColumnFlags::TIMESTAMP)
|
||||||
|
{
|
||||||
f.write_str(" UNSIGNED")?;
|
f.write_str(" UNSIGNED")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user