@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
31 lines (21 loc) • 1.39 kB
Markdown
lang: en
title: 'API docs: repository.schemamigrationoptions'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.schemamigrationoptions.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [SchemaMigrationOptions](./repository.schemamigrationoptions.md)
## SchemaMigrationOptions interface
**Signature:**
```typescript
export interface SchemaMigrationOptions extends Options
```
**Extends:** [Options](./repository.options.md)
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [existingSchema?](./repository.schemamigrationoptions.existingschema.md) | | 'drop' \| 'alter' | <p>_(Optional)_ When set to 'drop', schema migration will drop existing tables and recreate them from scratch, removing any existing data along the way.</p><p>When set to 'alter', schema migration will try to preserve current schema and data, and perform a non-destructive incremental update.</p> |
| [models?](./repository.schemamigrationoptions.models.md) | | string\[\] | <p>_(Optional)_ List of model names to migrate.</p><p>By default, all models are migrated.</p> |