Код: Выделить всё
Add-Migration AdminSett
Миграция леса «AdminSett». Код дизайнера для этого
файла миграции включает снимок вашей текущей модели Code First.
Этот снимок используется для расчета изменений в вашей модели, когда вы
создаете основу для следующей миграции. Если вы внесете дополнительные изменения в свою
модель, которую хотите включить в эту миграцию, вы можете
повторно создать ее, запустив команду Add-Migration AdminSett еще раз.
Код: Выделить всё
Update-Database AdminSett
Укажите флаг «-Verbose», чтобы просмотреть операторы SQL, применяемые
к целевой базе данных. Применение явных миграций:
[201607011035464_AdminSett]. Применение явной миграции:
201607011035464_AdminSett. System.Data.SqlClient.SqlException
(0x80131904): в базе данных
уже существует объект с именем «AdminSettings». at
System.Data.SqlClient.SqlConnection.OnError(исключение SqlException,
логическое значение BreakConnection, Action
Код: Выделить всё
1 wrapCloseInAction) at
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection, ActionSystem.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) в
System.Data.SqlClient.TdsParser.TryRun( Runbehavior Runbehavior,
sqlcommand cmdhandler, sqladatareader datastream,
bulkcopysimpleresteltset bulkcopyhandler, tdsparserstateobject
stateobj, boolean & dataready) at stystemend /> имя_метода, логическое значение async, время ожидания Int32, логическое значение asyncWrite) в
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource)
Код: Выделить всё
1
completion, String methodName, Boolean sendToPipe, Int32 timeout,
Boolean asyncWrite) at
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at
System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.b__0(DbCommand
t, DbCommandInterceptionContextSystem.Data.Entity.Infrastructure.Interception.InternalDispatcher
Код: Выделить всё
1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget
target, FuncДействие
Код: Выделить всё
3 executing, ActionSystem.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(команда DbCommand
, DbCommandInterceptionContext interceptionContext) в
System.Data.Entity.Internal.InterceptableDbCommand .ExecuteNonQuery()
at
System.Data.Entity.Migrations.DbMigrator.ExecuteSql(MigrationStatement
migrationStatement, соединение DbConnection, транзакция DbTransaction
, DbInterceptionContext interceptionContext) at
System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.ExecuteSql(MigrationStatement
migrationStatement, соединение DbConnection, транзакция DbTransaction
, DbInterceptionContext interceptionContext) at
System.Data.Entity.Migrations .DbMigrator.ExecuteStatementsInternal(IEnumerable
Код: Выделить всё
1
migrationStatements, DbConnection connection, DbTransaction
transaction, DbInterceptionContext interceptionContext) at
System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsWithinTransaction(IEnumerablemigrationStatements, транзакция DbTransaction, DbInterceptionContext
interceptionContext) at
System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsWithinNewTransaction(IEnumerable)
Код: Выделить всё
1
migrationStatements, DbConnection connection, DbInterceptionContext
interceptionContext) at
System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsInternal(IEnumerablemigrationStatements, соединение DbConnection, DbInterceptionContext
interceptionContext) at
System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsInternal(IEnumerable
Код: Выделить всё
1
migrationStatements, DbConnection connection) at
System.Data.Entity.Migrations.DbMigrator.c__DisplayClass30.b__2e()
at
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.c__DisplayClass1.b__0()
at
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Funcоперация) в
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action
операция) в
System.Data.Entity.Migrations.DbMigrator. ExecuteStatements(IEnumerable
Код: Выделить всё
1
migrationStatements, DbTransaction existingTransaction) at
System.Data.Entity.Migrations.DbMigrator.ExecuteStatements(IEnumerablemigrationStatements) в
System.Data.Entity.Migrations.Infrastructure.MigratorBase.ExecuteStatements(IEnumerable
Код: Выделить всё
1
migrationStatements) at
System.Data.Entity.Migrations.DbMigrator.ExecuteOperations(String
migrationId, VersionedModel targetModel, IEnumerableIEnumerable
Код: Выделить всё
1 systemOperations, Boolean downgrading, Boolean auto)
at System.Data.Entity.Migrations.DbMigrator.ApplyMigration(DbMigration
migration, DbMigration lastMigration) at
System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.ApplyMigration(DbMigration
migration, DbMigration lastMigration) at
System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerablependingMigrations, String targetMigrationId, String LastMigrationId)
at
System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.Upgrade(IEnumerable`1
pendingMigrations, String targetMigrationId, String LastMigrationId)
в System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String
targetMigration) в
System.Data.Entity.Migrations. DbMigrator.c__DisplayClassc.b__b()
в
System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action
mustSucceedToKeepDatabase) в
System.Data.Entity.Migrations. Infrastructure.MigratorBase.EnsureDatabaseExists(Action
mustSucceedToKeepDatabase) в
System.Data.Entity.Migrations.DbMigrator.Update(String
targetMigration) в
System.Data.Entity.Migrations. Infrastructure.MigratorBase.Update(String
targetMigration) в
System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.Run()
в System.AppDomain.DoCallBack(CrossAppDomainDelegate
callBackDelegate) в
System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
в System.Data.Entity.Migrations.Design.ToolingFacade.Run (бегун BaseRunner
) в
System.Data.Entity.Migrations.Design.ToolingFacade.Update(String
targetMigration, Boolean Force) at
System.Data.Entity.Migrations.UpdateDatabaseCommand.c__DisplayClass2.b__0 ()
at
System.Data.Entity.Migrations.MigrationsDomainCommand.Execute (команда Action
) ClientConnectionId:dec63212-4546-48a9-bf8e-9e2b8548fcf3 Ошибка
Номер: 2714, Состояние:6,Класс:16 В базе данных уже существует объект с именем
«AdminSettings».
Также в базе данных Таблица _Migrations в базе данных. Для миграции нет строки с именем: AdminSett
Подробнее здесь: https://stackoverflow.com/questions/381 ... e-database