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!


migrateSchema(options?: SchemaMigrationOptions): Promise<void>;


Parameter Type Description
options SchemaMigrationOptions (Optional) Migration options, e.g. whether to update tables preserving data or rebuild everything from scratch.