I have solution for Stored Procedures creation exactly like in this answer https://stackoverflow.com/a/15171900.
I am running
Sql(Properties.Resources.Create_sp_DoSomething);
in my Initial DbMigration.
My sql scripts have code to first drop existing SP and then create new updated SP. So whene I run
Sql(Properties.Resources.Create_sp_DoSomething);
in new DbMigration, and logic inside SP is changed everything works fine.
The problem arise when I want to update Stored Procedure with columns (lets say IsActive) which were added to model in later commits, and I am updating without existing DB (so new DB is created). Then It fails with
Invalid column name 'IsActive'.
Any good solution to that other than removing all existing calls to
Sql(Properties.Resources.Create_sp_DoSomething);
and have it only in newest DbMigration.