---
lang: en
title: 'API docs: repository.repositorymixindoc.migrateschema'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.repositorymixindoc.migrateschema.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [RepositoryMixinDoc](./repository.repositorymixindoc.md) &gt; [migrateSchema](./repository.repositorymixindoc.migrateschema.md)

## 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!

<b>Signature:</b>

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  options | <code>SchemaMigrationOptions</code> | Migration options, e.g. whether to update tables preserving data or rebuild everything from scratch. |

<b>Returns:</b>

`Promise<void>`


