Skip to content

Commit

Permalink
refactor(migrate): Simplify engine API of evaluateDataLoss in Migrate (
Browse files Browse the repository at this point in the history
…#7576)

Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 11, 2021
1 parent 5762df6 commit df476b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/packages/migrate/README.md
Expand Up @@ -24,7 +24,6 @@

**Prisma Migrate** is an imperative database schema migration tool that enables you to make changes to your database schema. Migrations are auto-generated based on the Prisma schema changes but are fully customizable.

> **WARNING**: Prisma Migrate is currently in an **preview**. There may be bugs and it's not recommended to use it in production environments.
> Please help us improve Prisma Migrate by creating [issues](https://github.com/prisma/prisma/issues/new/choose) and sharing your [feedback](https://slack.prisma.io/) with us.
## Documentation
Expand Down
5 changes: 1 addition & 4 deletions src/packages/migrate/src/commands/MigrateDev.ts
Expand Up @@ -228,10 +228,7 @@ ${chalk.bold('Examples')}
}

let migrationName: undefined | string = undefined
if (
evaluateDataLossResult.migrationSteps.length > 0 ||
args['--create-only']
) {
if (evaluateDataLossResult.migrationSteps > 0 || args['--create-only']) {
const getMigrationNameResult = await getMigrationName(args['--name'])

if (getMigrationNameResult.userCancelled) {
Expand Down
4 changes: 2 additions & 2 deletions src/packages/migrate/src/types.ts
Expand Up @@ -123,8 +123,8 @@ export namespace EngineResults {
// Todo
}
export interface EvaluateDataLossOutput {
/// The migration steps that would be generated. If this is 0, we wouldn't generate a new migration, unless the `draft` option is passed.
migrationSteps: string[]
/// The number of migration steps that would be generated. If this is 0, we wouldn't generate a new migration, unless the `draft` option is passed.
migrationSteps: number

/// The warnings and unexecutable migration messages that apply to the _development database_.
/// The warnings for the production databases are written as comments into the migration scripts.
Expand Down

0 comments on commit df476b9

Please sign in to comment.