Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't store empty migrations #399

Closed
jsprw opened this issue Mar 12, 2020 · 1 comment
Closed

Don't store empty migrations #399

jsprw opened this issue Mar 12, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@jsprw
Copy link
Contributor

jsprw commented Mar 12, 2020

Is your feature request related to a problem? Please describe.
When running migrations automatically on file changes, it saves a migration file although nothing has changed with the following contents:

import { Migration } from 'mikro-orm';

export class Migration20200312115106 extends Migration {

  async up(): Promise<void> {

  }

}

Describe the solution you'd like
Don't store migrations without any changes, maybe have an option to disable storing empty migrations?

@jsprw jsprw added the enhancement New feature or request label Mar 12, 2020
@B4nan
Copy link
Member

B4nan commented Mar 12, 2020

I think we do not need an additional option, there is already a way to generate blank migration.

When you use the automatic way, it should definitely ignore the run when the schema generator returns no queries.

@B4nan B4nan closed this as completed in 564e988 Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants