0

We have large number (about 735) of migrations in our project. In some of them, we have made manual changes. How we can convert them to single file or decrease the number of them? We cant remove migrations and add a new migration to make them a single file, because we will lose manual changes that we do in migrations.

Solution of project

3
  • What kind of manual changes do you have? Commented Apr 28, 2020 at 16:46
  • we have manual Events and some ‎ interface Classes Commented Apr 30, 2020 at 8:33
  • no offense there are more ortographical errors than line of codes Commented Nov 24, 2024 at 15:05

1 Answer 1

1

(we cant remove migrations and Add a new migration for make them to a single file ,because we will lost manual changes that we do in migrations).

That is the method. You shouldn't be making manual changes to the migrations, in the first place, and this is one reason why. You either go code-first, and generate migrations from your code (only) or you go database-first, and scaffold the code based on the database. You're trying to do some hybrid, where you're making changes to the database that aren't being reflected in your code, and that's bad design.

Sign up to request clarification or add additional context in comments.

1 Comment

I believe sometimes you are forced to make manual changes to migrations, like for me to set NO CACHE on sequences or if you want to use stored procedures.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.