Today I maintain project that has really messy DB that need a lot of refactor and publish on clients machines.
I know that I could add a SQL Server Database project that contains just scripts of the database and creates a .dacpac
file that allows me to change clients databases automatically.
Also I know that I could just add an .mdf
file to the App_Data
or even to Solution_Data
folder and have my database there. I suppose that localDb
that already exists allows me to startup my solution without SQL Server
And atlast i know that Entity Framework exist with it's own migrations. But i don't want to use it, besouse i can't add and change indexes with it's migrations and i don't have anought flexibility when i need to describe difficult migrations scenarios.
My goals:
- Generate migration scripts to clients DB's automaticaly.
- Make my solution self-contained, that any new Programmer that came to project don't even need to install SQL Server on his machine.
- Be able to update local (development) base in 1-2 clicks.
- Be able to move back in history of db changes (I have TFS server)
- Be able to have clean (only with dictionaries or lookup tables) db in solution with up to date DB scheme.
- Additionally i want to be able to update my DB model (EF or
.dbml
) automatically or very easy way.
So what I what to ask:
What's a strengths and weaknesses of using this 2 approaches if I want to achive my goals?
Can be that I should use sort of combination of this tools?
Or don't I know about other existing tool from MS?
Is there a way to update my DAL model from this DB?
LocalDB
is another developer-oriented version of SQL Server Express - and if you want to use a.mdf
file locally on a machine, you must have SQL Server Express installed. If you put the database on the server in a network (where it really belongs), then you can connect any number of PC's to it, without having a local copy of SQL Server installed – Semiconscious