(db: &DbConn)
| 70 | } |
| 71 | |
| 72 | pub async fn create_log_table(db: &DbConn) -> Result<ExecResult, DbErr> { |
| 73 | let stmt = sea_query::Table::create() |
| 74 | .table(applog::Entity) |
| 75 | .comment("app logs") |
| 76 | .col( |
| 77 | ColumnDef::new(applog::Column::Id) |
| 78 | .integer() |
| 79 | .not_null() |
| 80 | .comment("ID") |
| 81 | .auto_increment() |
| 82 | .primary_key(), |
| 83 | ) |
| 84 | .col( |
| 85 | ColumnDef::new(applog::Column::Action) |
| 86 | .string() |
| 87 | .not_null() |
| 88 | .comment("action"), |
| 89 | ) |
| 90 | .col( |
| 91 | ColumnDef::new(applog::Column::Json) |
| 92 | .json() |
| 93 | .not_null() |
| 94 | .comment("action data"), |
| 95 | ) |
| 96 | .col( |
| 97 | ColumnDef::new(applog::Column::CreatedAt) |
| 98 | .timestamp_with_time_zone() |
| 99 | .not_null() |
| 100 | .comment("create time"), |
| 101 | ) |
| 102 | .to_owned(); |
| 103 | |
| 104 | create_table(db, &stmt, Applog).await |
| 105 | } |
| 106 | |
| 107 | pub async fn create_metadata_table(db: &DbConn) -> Result<ExecResult, DbErr> { |
| 108 | let stmt = sea_query::Table::create() |
no test coverage detected