Skip to content

Commit

Permalink
Fixed datetime with timezone creation
Browse files Browse the repository at this point in the history
  • Loading branch information
myOmikron committed Sep 11, 2023
1 parent 5ef004f commit 74a0a49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/create_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ impl<'until_build, 'post_build> CreateColumn<'post_build>
DbType::Double => write!(s, "double precision ").unwrap(),
DbType::Boolean => write!(s, "boolean ").unwrap(),
DbType::Date => write!(s, "date ").unwrap(),
DbType::DateTime | DbType::Timestamp => write!(s, "timestamp ").unwrap(),
DbType::DateTime => write!(s, "timestamptz").unwrap(),
DbType::Timestamp => write!(s, "timestamp ").unwrap(),
DbType::Time => write!(s, "time ").unwrap(),
};

Expand All @@ -456,7 +457,7 @@ impl<'until_build, 'post_build> CreateColumn<'post_build>
"DEFAULT {}",
match d.data_type {
DbType::Date => "CURRENT_DATE",
DbType::DateTime => "CURRENT_TIMESTAMP",
DbType::DateTime => "now()",
DbType::Timestamp => "CURRENT_TIMESTAMP",
DbType::Time => "CURRENT_TIME",
_ => "",
Expand Down

0 comments on commit 74a0a49

Please sign in to comment.