-1

If I was to make a change to my database from

Sql("SET IDENTITY_INSERT Genres ON");

Sql("INSERT INTO Genres (Id, Name) VALUES (1, 'Action')");
Sql("INSERT INTO Genres (Id, Name) VALUES (2, 'Thriller')");
Sql("INSERT INTO Genres (Id, Name) VALUES (3, 'Family')");
Sql("INSERT INTO Genres (Id, Name) VALUES (4, 'Romance')");
Sql("INSERT INTO Genres (Id, Name) VALUES (5, 'Comedy')");

Sql("SET IDENTITY_INSERT Genres OFF");

to

Sql("INSERT INTO Genres (Name) VALUES ('Action')");
Sql("INSERT INTO Genres (Name) VALUES ('Thriller')");
Sql("INSERT INTO Genres (Name) VALUES ('Family')");
Sql("INSERT INTO Genres (Name) VALUES ('Romance')");
Sql("INSERT INTO Genres (Name) VALUES ('Comedy')");

Would I need to add a new migration or simply update the database for the changes to take effect?

ECL-94
  • 97
  • 3
  • 9

1 Answers1

1

Migration is for registering model changes in the database. You should create a migration to any changes you make to your model. Meanwhile, migrations are for displaying the changes and the process of creating your database, and you can remove them after the completion of the project if you are sure you will not change.

topcool
  • 2,498
  • 7
  • 28
  • 52