it:ad:code_first:migrations:howto:script_contents_of_migrationshistory_db_table

IT:AD:EF/CodeFirst/Migrations:HowTo:Script/Contents of __MigrationsHistory Db Table

Summary

You'll find that when you try to export a Database that's been enabled for IT:AD:Code First:Migrations, even if you've chosen to script Schema and Data, the __MigrationsHistory won't be mentioned in your script.

That's annoying…

It's because it's a Systems Table.

But it's not essential that it's a System Table. So you can do the following:


  SELECT * 
  INTO [TempMigrationHistory] 
  FROM [__MigrationHistory]

  DROP TABLE [__MigrationHistory]

  EXEC sp_rename 'TempMigrationHistory', '__MigrationHistory'
  
 

  • /home/skysigal/public_html/data/pages/it/ad/code_first/migrations/howto/script_contents_of_migrationshistory_db_table.txt
  • Last modified: 2023/11/04 02:19
  • by 127.0.0.1