When I make a database change, how do I know what needs to be removed and readded to the LinqToSql O/R Designer in Visual Studio?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 06:50:59

问题


For example, I alter a column in a table to be not null from null.

I need to then delete and readd the table. That part is pretty clear.

What about views, functions, and stored procedures that access the table, especially that column in the table?

I've tried running diffs against the files generated by SQLMetal with some limited success, but even with that it's fairly unclear.

I know there is at least one commercial tool out there that claims to address this problem, but I am looking for something free.

How are people dealing with this issue?


回答1:


+1 on the question.

But what's bad about using a commercial tool if it solves the problem? After all, if you spend an hour per week on manually matching up changes instead of hitting a button that does it all for you, then the license cost of using a commercial tool will pay itself back in no time at all. All tools that address this issue cost a fraction of a Visual Studio license, have free trials, and the price is not more than an hour of work for most devs. Just my 2 cents.

That said, I agree it would be neat if this functionality was available for free. I have tried suggesting that to MSFT many times but they don't seem to be interested in that. (as in: they don't even reply back... :) )




回答2:


It seems you are putting a lot of business logic into your SQL DB rather than keeping it in the app itself. Try adopting a more DDD approach with a Domain Model - this should move much of the work those SPs and Views from the db are doing back into the application where they belong. Then your db should only be for persisting data and hence changed to tables should only require a very small amount of time in the L2S designer to make updates.



来源:https://stackoverflow.com/questions/956131/when-i-make-a-database-change-how-do-i-know-what-needs-to-be-removed-and-readde

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!