Skip to main content

Posts

Customize your EntityFramework Core Migrations

Why Customize? If you have used migrations in EF6, and you remember how the dbo.__MigrationHistory table looked like, you might recall it had a column for ContextKey. This contained the complete namespace of the DbContext, to which a migration belonged. This was important because, there is a slight possibility that developers working on multiple DbContexts can accidentally give same name to their migrations. I do that when I start. All my DbContexts have the first migration called Init. I had no issues because these migration files existed in their own folder structures. Also when applied to the database, although the migrations had same names (ignoring the timestamps), they still had a ContextKey associated in the MigrationHistory table. Enter EF Core, things changed. The column ContextKey was dropped. So my migrations look all the same.(again ignoring the timestamp). This pissed me off. I wanted complete control over how my migrations look like, be it as database entries, or fil
Recent posts

Invoking the thought process

Thoughts, ideas and dreams.Things without which it is a life as worthless as anything. Our deeds are a clear reflection of what we think - be it any matter for the sake of discussion. It is really a neccessity to be thoughtfully active which is a scale of our mind activity. The more we think, the more we develop a view about something. And this determines the amount of understanding we have developed about things of concern. Dreams are something which we all know by the phrase- unfulfilled desires. So naturally, thinking big and intelligent makes you dream of big and great goals. Everyone has got a beautiful mind which when best used definintely can result in wonderful thoughts, ideas and dreams. Thats some food for thought, think about it.