Maybe you can add this to your Startup.Configure ?
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
I set the LogLevel to Trace for everything and in the Output window I see it trying to apply all of the update scripts.
However, it's trying to do this in 12.8.0.sql
ALTER TABLE [dbo].[tblMappedIdentity]
ADD [Metadata] NVARCHAR (MAX) NULL,
[Saved] DATETIME NULL;
but my cms11 database already looks like this...
the error:
System.Data.DataException: Failed to update database during execution of statement 'ALTER TABLE [dbo].[tblMappedIdentity]
ADD [Metadata] NVARCHAR (MAX) NULL,
[Saved] DATETIME NULL;
'
---> Microsoft.Data.SqlClient.SqlException (0x80131904): Column names in each table must be unique. Column name 'Metadata' in table 'dbo.tblMappedIdentity' is specified more than once.
I see, it is possible to just drop the two columns and proceed - especially as this is for local development it should not have any consequences.
I will look into this to see if we can do anything about it
I tried your suggestion and removed the two columns. The db upgrade script now gets to 12.8.0.sql and errors trying to create a stored proc.
Microsoft.Data.SqlClient.SqlException (0x80131904): There is already an object named 'netMappedIdentitySetMetadata' in the database.
I deleted the stored proc 'netMappedIdentitySetMetadata' and now the db updates finish without an error.
Public Bug posted: https://world.optimizely.com/support/bug-list/bug/CMS-31381
I setup a local db from a copy from PROD.
In Visual Studio, I setup an Optimizely CMS empty project and set the "EPiServerDB" connection string to this local db.
When running the site I get an error ‘Failed to update database’.
This is the only package in the Project:
<PackageReference Include="EPiServer.CMS" Version="12.26.0" />
Where can I look to see why the db upgrade is failing?