Skip to content

Baseline existing db #604

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

Closed
1 task
SergeyCherman opened this issue Dec 27, 2018 · 3 comments
Closed
1 task

Baseline existing db #604

SergeyCherman opened this issue Dec 27, 2018 · 3 comments
Labels

Comments

@SergeyCherman
Copy link

SergeyCherman commented Dec 27, 2018

I'm submitting a...

  • Bug report
  • [ X] Feature request
  • [X ] Question

Is there a way to baseline an existing database? For example if adding db-migrate to an existing database we might not want to run some of the migrations. Is there a way to only run migrations newer then the baseline?

@wzrdtales
Copy link
Member

No, there is no way of skipping them. I would suggest you simply backup the migrations table as well. Maybe you could provide a use case should this be still from interest.

@stale
Copy link

stale bot commented Feb 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 7, 2019
@stale stale bot closed this as completed Feb 14, 2019
@tchar
Copy link

tchar commented Feb 21, 2023

Hello, I am checking to see if this is something that is/could be implemented. I scanned the docs fast and there is no mention to mark a migration applied or baseline.

Here are some use cases:

  1. I already have a database with all the migrations in SQL files and I don't want to run them as they already exist and I was not using any tool up to this point. I want to keep track of the migrations from this point and onward.
  2. I usually test my migrations on some development SQL. After I am happy with the result, I save the code to the migration file. So for development, I want to mark the migration as complete/baseline so it does not run again. Then when I run it on production it runs properly
  3. A more important use case which is similar to 2 when you have to issue hotfixes is explained by flyway here.

Although 3 is more important. 1 is the one that does not allow people to start using the tool midway. They either have to start using it from the beginning or not use it at all.

Cheers
tchar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants