fix(mariadb): don't append UNSIGNED to the type of timestamp columns

This commit is contained in:
Ryan Leckey 2020-06-10 04:24:34 -07:00
parent 1dac0b5c29
commit 475ed9e1df

View File

@ -52,7 +52,11 @@ impl Display for MySqlTypeInfo {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
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")?;
}