There was an error while loading. Please reload this page.
1 parent 90f4da0 commit f7604feCopy full SHA for f7604fe
1 file changed
sea-orm-migration/src/schema.rs
@@ -293,6 +293,11 @@ pub fn date_time_uniq<T: IntoIden>(col: T) -> ColumnDef {
293
date_time(col).unique_key().take()
294
}
295
296
+/// A date time column with a server-side default of 'now'.
297
+pub fn date_time_default_now<T: IntoIden>(col: T) -> ColumnDef {
298
+ date_time(col).default(Expr::current_timestamp()).take()
299
+}
300
+
301
pub fn interval<T: IntoIden>(
302
col: T,
303
fields: Option<PgInterval>,
0 commit comments