(db: &DbConn)
| 217 | } |
| 218 | |
| 219 | pub async fn create_active_enum_child_table(db: &DbConn) -> Result<ExecResult, DbErr> { |
| 220 | let create_table_stmt = sea_query::Table::create() |
| 221 | .table(active_enum_child::Entity.table_ref()) |
| 222 | .col( |
| 223 | ColumnDef::new(active_enum_child::Column::Id) |
| 224 | .integer() |
| 225 | .not_null() |
| 226 | .auto_increment() |
| 227 | .primary_key(), |
| 228 | ) |
| 229 | .col( |
| 230 | ColumnDef::new(active_enum_child::Column::ParentId) |
| 231 | .integer() |
| 232 | .not_null(), |
| 233 | ) |
| 234 | .col(ColumnDef::new(active_enum_child::Column::Category).string_len(1)) |
| 235 | .col(ColumnDef::new(active_enum_child::Column::Color).integer()) |
| 236 | .col( |
| 237 | ColumnDef::new(active_enum_child::Column::Tea) |
| 238 | .enumeration(TeaEnum, [TeaVariant::EverydayTea, TeaVariant::BreakfastTea]), |
| 239 | ) |
| 240 | .foreign_key( |
| 241 | ForeignKeyCreateStatement::new() |
| 242 | .name("fk-active_enum_child-active_enum") |
| 243 | .from_tbl(ActiveEnumChild) |
| 244 | .from_col(active_enum_child::Column::ParentId) |
| 245 | .to_tbl(ActiveEnum) |
| 246 | .to_col(active_enum::Column::Id), |
| 247 | ) |
| 248 | .to_owned(); |
| 249 | |
| 250 | create_table(db, &create_table_stmt, ActiveEnumChild).await |
| 251 | } |
| 252 | |
| 253 | pub async fn create_satellites_table(db: &DbConn) -> Result<ExecResult, DbErr> { |
| 254 | let stmt = sea_query::Table::create() |
no test coverage detected