Add timestamp columns (`CreatedAt` and `UpdatedAt`) to an existing table.
(t: TableCreateStatement)
| 601 | |
| 602 | /// Add timestamp columns (`CreatedAt` and `UpdatedAt`) to an existing table. |
| 603 | pub 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. |
| 611 | pub fn name<T: Into<String>>(name: T) -> Alias { |
no test coverage detected