I want to delete a table with thousands of columns and let the migration recreate it. I can release
DropTable("MyTableWithManyColumns");
But the problem is that I would make a manual creation table like this
CreateTable( "dbo.MyTable", c => new { RowId = c.Int(nullable: false, identity: true), // many columns follow... }) .PrimaryKey(t => t.RowId);
An easier way to do this is to use SSMS and right-click Drop Create Table in a new window and run from there.
But is there an easy way to use code migration?
I see two possible ways:
Add-Migration
Update-Database
, !
:
, . , , . , , .
DbSets Context , , , Entity-Framework-Core .
, . - .
, :
SQL Management Studio ( , , , ). (FK), .., MyTable. SQL- MyTable. , , (, ), , FK.
Just to check the database, I tried to make changes to the database.
ADD-MIGRATION XYZ UPDATE-DATABASE -VERBOSE
Everything worked.
Everything will work correctly. Successful coding.
Source: https://habr.com/ru/post/1619874/More articles:JStree - copy only files with folders to dnd - javascriptНе удается развернуть приложение Xamarin Правильно - androidWhat is the length of crawl in google next to api message? - androidFixed value of field width in perl - formatWPF PRISM 6 DelegateComand ObservesCanExecute - wpfНеобработанные незавершенные операции для моделей при попытке выполнить миграцию - pythonLaravel 5.1 Page Authentication Using Routes - authenticationdjango - filter after a slice / filter on a query where the results were limited - pythonWhy does he say that the lowest number is always Zero? - javaLink to this pointer in the constructor - c ++All Articles