Skip to content

Commit 74a0a49

Browse files
committed
Fixed datetime with timezone creation
1 parent 5ef004f commit 74a0a49

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/create_column.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ impl<'until_build, 'post_build> CreateColumn<'post_build>
435435
DbType::Double => write!(s, "double precision ").unwrap(),
436436
DbType::Boolean => write!(s, "boolean ").unwrap(),
437437
DbType::Date => write!(s, "date ").unwrap(),
438-
DbType::DateTime | DbType::Timestamp => write!(s, "timestamp ").unwrap(),
438+
DbType::DateTime => write!(s, "timestamptz").unwrap(),
439+
DbType::Timestamp => write!(s, "timestamp ").unwrap(),
439440
DbType::Time => write!(s, "time ").unwrap(),
440441
};
441442

@@ -456,7 +457,7 @@ impl<'until_build, 'post_build> CreateColumn<'post_build>
456457
"DEFAULT {}",
457458
match d.data_type {
458459
DbType::Date => "CURRENT_DATE",
459-
DbType::DateTime => "CURRENT_TIMESTAMP",
460+
DbType::DateTime => "now()",
460461
DbType::Timestamp => "CURRENT_TIMESTAMP",
461462
DbType::Time => "CURRENT_TIME",
462463
_ => "",

0 commit comments

Comments
 (0)