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

k ef remove to current migration (and squash migrations) #2031

Closed
Bartmax opened this issue Apr 18, 2015 · 5 comments
Closed

k ef remove to current migration (and squash migrations) #2031

Bartmax opened this issue Apr 18, 2015 · 5 comments

Comments

@Bartmax
Copy link

Bartmax commented Apr 18, 2015

right now if I have 25 migrations and I do a

k ef migration apply 0

then I have to execute

k ef migration remove

25 times to get the migrations clean.
I know this is not a very real scenario, but I was thinking if a remove to current would be a good idea

k ef migration remove notapplied

sorry if there is something to do this already.

@Bartmax
Copy link
Author

Bartmax commented Apr 18, 2015

I use this because while development I go and create as many migrations I need as soon as I need them (domain driven database design :D hehe) and when I feel like I'm done, I go back all the migrations and add a fresh one (aka merge all migrations into one). (also fixes some migration bugs)

@bricelam
Copy link
Contributor

We often talk about this as the Squash Migrations command, I don't think we have an issue for it. If you're removing all migrations, you can just delete the *.cs files for the migrations and model snapshot after running Apply-Migration 0.

@bricelam
Copy link
Contributor

If we implement #1298, you would be able to delete the migration files and the snapshot for the ones you want to remove. The snapshot would then be re-generated on the next add.

@Bartmax
Copy link
Author

Bartmax commented Apr 19, 2015

sounds good. thank you @bricelam

@divega divega added this to the Backlog milestone May 7, 2015
@divega divega changed the title k ef remove to current migration k ef remove to current migration (and squash migrations) May 7, 2015
@rowanmiller
Copy link
Contributor

Triage Added an issue to track the squash scenario #2174. Think we have everything covered now.

@divega divega removed this from the Backlog milestone May 8, 2017
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants