(db: &DbConn)
| 176 | } |
| 177 | |
| 178 | pub async fn create_byte_primary_key_table(db: &DbConn) -> Result<ExecResult, DbErr> { |
| 179 | let mut primary_key_col = ColumnDef::new(byte_primary_key::Column::Id); |
| 180 | match db.get_database_backend() { |
| 181 | DbBackend::MySql => primary_key_col.binary_len(3), |
| 182 | DbBackend::Sqlite | DbBackend::Postgres => primary_key_col.binary(), |
| 183 | }; |
| 184 | |
| 185 | let stmt = sea_query::Table::create() |
| 186 | .table(byte_primary_key::Entity) |
| 187 | .col(primary_key_col.not_null().primary_key()) |
| 188 | .col( |
| 189 | ColumnDef::new(byte_primary_key::Column::Value) |
| 190 | .string() |
| 191 | .not_null(), |
| 192 | ) |
| 193 | .to_owned(); |
| 194 | |
| 195 | create_table_without_asserts(db, &stmt).await |
| 196 | } |
| 197 | |
| 198 | pub async fn create_active_enum_table(db: &DbConn) -> Result<ExecResult, DbErr> { |
| 199 | let create_table_stmt = sea_query::Table::create() |
no test coverage detected