Closed phillipzada closed 8 years ago
Workaround - For anyone else experiencing this issue
AddColumn("identityserver.Clients", "AllowAccessTokensViaBrowser", c => c.Boolean(nullable: false));
AddColumn("identityserver.Clients", "RequireSignOutPrompt", c => c.Boolean(nullable: false));
AddColumn("identityserver.Scopes", "AllowUnrestrictedIntrospection", c => c.Boolean(nullable: false));
I think its a bug in EF framework where it doesn't check the schema when it does it checks to see if the __MigrationHistory table exists.
I was able to solve this problem by just creating a Dummy __MigrationHistory table with the dbo schema, this tricked the EF6 generator for "creating the table"
CREATE TABLE [dbo].[__MigrationHistory] (
[MigrationId] [nvarchar](150) NOT NULL,
[ContextKey] [nvarchar](300) NOT NULL,
[Model] [varbinary](max) NOT NULL,
[ProductVersion] [nvarchar](32) NOT NULL,
CONSTRAINT [PK_dbo.__MigrationHistory] PRIMARY KEY ([MigrationId], [ContextKey])
)
Alternatively if you want to automate it, you'll have to create a "Empty Migration" with a dummy class that uses the dbo schema and run that migration first to generate the relevant tables. Then run the scripts for the migration with the different schema and it should work.
Getting an error when executing the Update-Database script on a clean install once upgraded to the new verision
There is already an object named '__MigrationHistory' in the database.
packages.config