MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / timestamps

Function timestamps

sea-orm-migration/src/schema.rs:603–608  ·  view source on GitHub ↗

Add timestamp columns (`CreatedAt` and `UpdatedAt`) to an existing table.

(t: TableCreateStatement)

Source from the content-addressed store, hash-verified

601
602/// Add timestamp columns (`CreatedAt` and `UpdatedAt`) to an existing table.
603pub fn timestamps(t: TableCreateStatement) -> TableCreateStatement {
604 let mut t = t;
605 t.col(timestamp(GeneralIds::CreatedAt).default(Expr::current_timestamp()))
606 .col(timestamp(GeneralIds::UpdatedAt).default(Expr::current_timestamp()))
607 .take()
608}
609
610/// Create an Alias.
611pub fn name<T: Into<String>>(name: T) -> Alias {

Callers 1

table_autoFunction · 0.85

Calls 3

timestampFunction · 0.85
takeMethod · 0.80
defaultMethod · 0.45

Tested by

no test coverage detected