Page Contents
Home > @loopback/repository > RepositoryMixinDoc > migrateSchema
RepositoryMixinDoc.migrateSchema() method
Update or recreate the database schema for all repositories.
**WARNING**: By default, migrateSchema()
will attempt to preserve data while updating the schema in your target database, but this is not guaranteed to be safe.
Please check the documentation for your specific connector(s) for a detailed breakdown of behaviors for automigrate!
Signature:
migrateSchema(options?: SchemaMigrationOptions): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
options | SchemaMigrationOptions | Migration options, e.g. whether to update tables preserving data or rebuild everything from scratch. |
Returns:
Promise<void>