jbogard / ContosoUniversityCore

MIT License
591 stars 151 forks source link

Question: Why not use EF migrations? #2

Closed egil closed 7 years ago

egil commented 7 years ago

Hi Jimmy,

I was reading through the code in this repo and started wondering why you do not use EF migrations. Can you elaborate on that decision?

Are there any pitfalls that makes it preferable just to have a hand-crafted SchemaAndData.sql?

Best, Egil

jbogard commented 7 years ago

The codebase doesn't use any migrations because we don't need to migrate anything, just schema and data. I thought a single SQL script would be easier than restoring a backup file. Maybe not!

We don't use EF or any code-base migrations, only SQL-based in any case, Roundhouse for example.

egil commented 7 years ago

Interesting, I did not know Roundhouse. To me it seems EF migrations do have some neat benefits, but I have yet to use it in a real production system. Do you mind sharing your thoughts on EF/other code-based database migration solutions vs. SQL-based ones?

jbogard commented 7 years ago

Well, with SQL, I have complete control of what's going to be executed against the DB. If something goes wrong, I have the exact SQL that executed. And RoundHouse supports a large number of scenarios (different environments, scripts for views/sprocs etc) that make it a comprehensive solution.

On Fri, Nov 11, 2016 at 10:49 AM, Egil Hansen notifications@github.com wrote:

Interesting, I did not know Roundhouse. To me it seems EF migrations do have some neat benefits, but I have yet to use it in a real production system. Do you mind sharing your thoughts on EF/other code-based database migration solutions vs. SQL-based ones?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jbogard/ContosoUniversityCore/issues/2#issuecomment-260000625, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGYMkH7Gbzx4vixoO7y4ihz-hDxiQUKks5q9JyJgaJpZM4Kvv-3 .

jbogard commented 7 years ago

It's at the root of the project.

On Thu, Nov 17, 2016 at 3:24 AM NagarajanGitHub notifications@github.com wrote:

Where can i find the "SchemaAndData.sql" file?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/jbogard/ContosoUniversityCore/issues/2#issuecomment-261196356, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGYMpFopRz_afw8TcaR3Gw5hOLHxPzDks5q_B1DgaJpZM4Kvv-3 .