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

Function create_self_join_table

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

Source from the content-addressed store, hash-verified

152}
153
154pub async fn create_self_join_table(db: &DbConn) -> Result<ExecResult, DbErr> {
155 let stmt = sea_query::Table::create()
156 .table(self_join::Entity)
157 .col(
158 ColumnDef::new(self_join::Column::Uuid)
159 .uuid()
160 .not_null()
161 .primary_key(),
162 )
163 .col(ColumnDef::new(self_join::Column::UuidRef).uuid())
164 .col(ColumnDef::new(self_join::Column::Time).time())
165 .foreign_key(
166 ForeignKeyCreateStatement::new()
167 .name("fk-self_join-uuid_ref")
168 .from_tbl(SelfJoin)
169 .from_col(self_join::Column::UuidRef)
170 .to_tbl(SelfJoin)
171 .to_col(self_join::Column::Uuid),
172 )
173 .to_owned();
174
175 create_table(db, &stmt, SelfJoin).await
176}
177
178pub 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);

Callers 1

create_tablesFunction · 0.85

Calls 4

createFunction · 0.50
newFunction · 0.50
create_tableFunction · 0.50
nameMethod · 0.45

Tested by

no test coverage detected