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

Method install

sea-orm-migration/src/migrator.rs:163–175  ·  view source on GitHub ↗

Create migration table `seaql_migrations` in the database

(db: &C)

Source from the content-addressed store, hash-verified

161
162 /// Create migration table `seaql_migrations` in the database
163 async fn install<C>(db: &C) -> Result<(), DbErr>
164 where
165 C: ConnectionTrait,
166 {
167 let builder = db.get_database_backend();
168 let table_name = Self::migration_table_name();
169 let schema = Schema::new(builder);
170 let mut stmt = schema
171 .create_table_from_entity(seaql_migrations::Entity)
172 .table_name(table_name);
173 stmt.if_not_exists();
174 db.execute(builder.build(&stmt)).await.map(|_| ())
175 }
176
177 /// Check the status of all migrations
178 async fn status<C>(db: &C) -> Result<(), DbErr>

Callers

nothing calls this directly

Implementers 15

lib.rssea-orm-cli/template/migration/src/lib
default.rssea-orm-migration/tests/common/migrato
override_migration_table_name.rssea-orm-migration/tests/common/migrato
lib.rsexamples/loco_seaography/migration/src
lib.rsexamples/seaography_example/migration/
lib.rsexamples/jsonrpsee_example/seeder/src/
lib.rsexamples/jsonrpsee_example/migration/s
lib.rsexamples/tonic_example/migration/src/l
lib.rsexamples/graphql_example/seeder/src/li
lib.rsexamples/graphql_example/migration/src
lib.rsexamples/axum_example/seeder/src/lib.r
lib.rsexamples/axum_example/migration/src/li

Calls 6

newFunction · 0.50
get_database_backendMethod · 0.45
table_nameMethod · 0.45
executeMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected