(db: &DbConn)
| 105 | } |
| 106 | |
| 107 | pub async fn create_metadata_table(db: &DbConn) -> Result<ExecResult, DbErr> { |
| 108 | let stmt = sea_query::Table::create() |
| 109 | .table(metadata::Entity) |
| 110 | .col( |
| 111 | ColumnDef::new(metadata::Column::Uuid) |
| 112 | .uuid() |
| 113 | .not_null() |
| 114 | .primary_key(), |
| 115 | ) |
| 116 | .col(ColumnDef::new(metadata::Column::Type).string().not_null()) |
| 117 | .col(ColumnDef::new(metadata::Column::Key).string().not_null()) |
| 118 | .col(ColumnDef::new(metadata::Column::Value).string().not_null()) |
| 119 | .col( |
| 120 | ColumnDef::new_with_type( |
| 121 | metadata::Column::Bytes, |
| 122 | ColumnType::VarBinary(StringLen::N(32)), |
| 123 | ) |
| 124 | .not_null(), |
| 125 | ) |
| 126 | .col(ColumnDef::new(metadata::Column::Date).date()) |
| 127 | .col(ColumnDef::new(metadata::Column::Time).time()) |
| 128 | .to_owned(); |
| 129 | |
| 130 | create_table(db, &stmt, Metadata).await |
| 131 | } |
| 132 | |
| 133 | pub async fn create_repository_table(db: &DbConn) -> Result<ExecResult, DbErr> { |
| 134 | let stmt = sea_query::Table::create() |
no test coverage detected