Reputation: 16502
I am trying to update a database using EF6 and code first migrations. The migration A
goes through all the steps and I trace out when it gets to the end. But it then errors out with this:
System.Data.SqlClient.SqlException (0x80131904): Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Migration B
is not even started, and when looking at the database, migration A
has not been committed.
It also only seems to be affecting this one database, as 99% of our other customers have migrated without issue. We have tried SQL2008 & 2014 with the same results. The db model is written in C#, .NET 4.6, and EF6.1.3
Upvotes: 1
Views: 356
Reputation: 16502
taking @stuartd's advice in the comments, I output the migration to a SQL script and ran it on the server. Doing this isolated the cause of the failed migration. The reason it did not error out at the exact line in code is because the migration takes place within a transaction.
Upvotes: 1