MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / create_active_enum_table

Function create_active_enum_table

tests/common/features/schema.rs:198–217  ·  view source on GitHub ↗
(db: &DbConn)

Source from the content-addressed store, hash-verified

196}
197
198pub async fn create_active_enum_table(db: &DbConn) -> Result<ExecResult, DbErr> {
199 let create_table_stmt = sea_query::Table::create()
200 .table(active_enum::Entity.table_ref())
201 .col(
202 ColumnDef::new(active_enum::Column::Id)
203 .integer()
204 .not_null()
205 .auto_increment()
206 .primary_key(),
207 )
208 .col(ColumnDef::new(active_enum::Column::Category).string_len(1))
209 .col(ColumnDef::new(active_enum::Column::Color).integer())
210 .col(
211 ColumnDef::new(active_enum::Column::Tea)
212 .enumeration(TeaEnum, [TeaVariant::EverydayTea, TeaVariant::BreakfastTea]),
213 )
214 .to_owned();
215
216 create_table(db, &create_table_stmt, ActiveEnum).await
217}
218
219pub async fn create_active_enum_child_table(db: &DbConn) -> Result<ExecResult, DbErr> {
220 let create_table_stmt = sea_query::Table::create()

Callers 1

create_tablesFunction · 0.85

Calls 5

table_refMethod · 0.80
createFunction · 0.50
newFunction · 0.50
create_tableFunction · 0.50
auto_incrementMethod · 0.45

Tested by

no test coverage detected