سؤال

My team and I are creating an ASP.NET MVC site using Entity Framework Code First.

We all want to share the same initial data that exists on my computer, but I really don't want to manually write Seed code for all of the data that I have entered in my local database.

How can I configure my current LocalDb so that it can be shared with everyone else using Git?

هل كانت مفيدة؟

المحلول

You will need to include your database file (.mdf and .ldf) in your git repo for this project. So get everything setup locally like you want it in your database. Push your local repo to the centralized repo. And have everyone else clone that repo as a starting point. That will give everyone the same starting point. If you don't want that to change anymore, everyone will need to add the database files (.mdf and .ldf) to the .gitignore file. Or just make sure that you don't git add those files and commit them unless you want everyone else to get those changes.

نصائح أخرى

You can export and import your data using microsoft server SQL management studio

Be sure to get your DB connection right

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top