-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed problem with index creating for case-sensitive db collations #18294
base: contrib
Are you sure you want to change the base?
Conversation
Hi there @Forevka, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why CS db collations can not use uniqueID
and parentID
?
If we change how we create these, it might lead to upgrade problems. So even if we say this is "fixed" in the next version, it is only really fixed when people create a new database.
I feel the actual solution might be updating the queries instead of the create scripts. I assume it's failing because of the queries failing, right?
@@ -48,7 +48,7 @@ public class NodeDto | |||
public string Path { get; set; } = null!; | |||
|
|||
[Column(SortOrderColumnName)] | |||
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_ObjectType_trashed_sorted", ForColumns = "nodeObjectType,trashed,sortOrder,id", IncludeColumns = "uniqueID,parentID,level,path,nodeUser,text,createDate")] | |||
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_ObjectType_trashed_sorted", ForColumns = "nodeObjectType,trashed,sortOrder,id", IncludeColumns = "uniqued,parentId,level,path,nodeUser,text,createDate")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_ObjectType_trashed_sorted", ForColumns = "nodeObjectType,trashed,sortOrder,id", IncludeColumns = "uniqued,parentId,level,path,nodeUser,text,createDate")] | |
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_ObjectType_trashed_sorted", ForColumns = "nodeObjectType,trashed,sortOrder,id", IncludeColumns = "uniqueId,parentId,level,path,nodeUser,text,createDate")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @nul800sebastiaan, this leads to an error during the initial database migration, because it is impossible to create an index for the specified columns since uniqueId != uniqueID with case-sensitive collation.
Please see part of the logs:
{"@t":"2025-02-11T12:20:39.2796191Z","@mt":"Create table:\n {Sql}","@tr":"6415db4e0853b4cbb5062270f2d91962","@sp":"8d6f3c4d10545188","Sql":"CREATE TABLE [umbracoNode] ([id] INTEGER NOT NULL IDENTITY(1,1),\n[uniqueId] UniqueIdentifier NOT NULL CONSTRAINT [DF_umbracoNode_uniqueId] DEFAULT (NEWID()),\n[parentId] INTEGER NOT NULL,\n[level] INTEGER NOT NULL,\n[path] NVARCHAR(150) NOT NULL,\n[sortOrder] INTEGER NOT NULL,\n[trashed] BIT NOT NULL CONSTRAINT [DF_umbracoNode_trashed] DEFAULT ('0'),\n[nodeUser] INTEGER NULL,\n[text] NVARCHAR(255) NULL,\n[nodeObjectType] UniqueIdentifier NULL,\n[createDate] DATETIME NOT NULL CONSTRAINT [DF_umbracoNode_createDate] DEFAULT (GETDATE()))","SourceContext":"Umbraco.Cms.Persistence.SqlServer.Services.SqlServerSyntaxProvider","ProcessId":29256,"ProcessName":"Blog","ThreadId":24,"ApplicationId":"08d2dc66a993f76545f5208950d8f826abf544ea","MachineName":"DESKTOP-OVT0GIF","Log4NetLevel":"INFO ","HttpRequestId":"2670c834-c616-4891-9d6b-8ce726271701","HttpRequestNumber":1,"HttpSessionId":"5c46077b-2a40-206b-7ad8-03264bf9a7c8","ActionId":"0222ec1a-29a3-4563-ac80-30f5bde9af61","ActionName":"Umbraco.Cms.Api.Management.Controllers.Install.SetupInstallController.Setup (Umbraco.Cms.Api.Management)","RequestId":"0HNAAIPS7E0J3:00000291","RequestPath":"/umbraco/management/api/v1/install/setup","ConnectionId":"0HNAAIPS7E0J3"}
{"@t":"2025-02-11T12:20:40.2607119Z","@mt":"Exception ({InstanceId}).","@l":"Error","@x":"Microsoft.Data.SqlClient.SqlException (0x80131904): Column name 'parentID' does not exist in the target table or view.\r\n at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)\r\n at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)\r\n at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()\r\n at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteNonQuery() in C:\\projects\\dotnet\\src\\MiniProfiler.Shared\\Data\\ProfiledDbCommand.cs:line 261\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.<ExecuteNonQuery>b__32_0()\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass38_0`1.<Execute>b__0()\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func`1 f)\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteNonQuery()\r\n at NPoco.Database.<>c__DisplayClass296_0.<ExecuteNonQueryHelper>b__0()\r\n at NPoco.Database.ExecutionHook[T](Func`1 action)\r\n at NPoco.Database.ExecuteNonQueryHelper(DbCommand cmd)\r\n at NPoco.Database.Execute(String sql, CommandType commandType, Object[] args)\r\n at NPoco.Database.Execute(Sql Sql)\r\n at Umbraco.Cms.Persistence.SqlServer.Services.MicrosoftSqlSyntaxProviderBase`1.HandleCreateTable(IDatabase database, TableDefinition tableDefinition, Boolean skipKeysAndIndexes)\r\n at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseSchemaCreator.CreateTable(Boolean overwrite, Type modelType, DatabaseDataCreator dataCreation)\r\n at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseSchemaCreator.InitializeDatabaseSchema()\r\n at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseBuilder.CreateSchemaAndData(ICoreScope scope)\r\nClientConnectionId:cd1433a5-7737-414a-88d7-7031656031cc\r\nError Number:1911,State:1,Class:16","@tr":"6415db4e0853b4cbb5062270f2d91962","@sp":"8d6f3c4d10545188","InstanceId":"77d28a53","SourceContext":"Umbraco.Cms.Infrastructure.Persistence.UmbracoDatabase","ActionId":"0222ec1a-29a3-4563-ac80-30f5bde9af61","ActionName":"Umbraco.Cms.Api.Management.Controllers.Install.SetupInstallController.Setup (Umbraco.Cms.Api.Management)","RequestId":"0HNAAIPS7E0J3:00000291","RequestPath":"/umbraco/management/api/v1/install/setup","ConnectionId":"0HNAAIPS7E0J3","ProcessId":29256,"ProcessName":"Blog","ThreadId":24,"ApplicationId":"08d2dc66a993f76545f5208950d8f826abf544ea","MachineName":"DESKTOP-OVT0GIF","Log4NetLevel":"ERROR","HttpRequestId":"2670c834-c616-4891-9d6b-8ce726271701","HttpRequestNumber":1,"HttpSessionId":"5c46077b-2a40-206b-7ad8-03264bf9a7c8"}
{"@t":"2025-02-11T12:20:40.2854882Z","@mt":"Database configuration failed","@l":"Error","@x":"Microsoft.Data.SqlClient.SqlException (0x80131904): Column name 'parentID' does not exist in the target table or view.\r\n at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, SqlCommand command, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)\r\n at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)\r\n at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()\r\n at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteNonQuery() in C:\\projects\\dotnet\\src\\MiniProfiler.Shared\\Data\\ProfiledDbCommand.cs:line 261\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.<ExecuteNonQuery>b__32_0()\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.<>c__DisplayClass38_0`1.<Execute>b__0()\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.Execute[T](Func`1 f)\r\n at Umbraco.Cms.Infrastructure.Persistence.FaultHandling.FaultHandlingDbCommand.ExecuteNonQuery()\r\n at NPoco.Database.<>c__DisplayClass296_0.<ExecuteNonQueryHelper>b__0()\r\n at NPoco.Database.ExecutionHook[T](Func`1 action)\r\n at NPoco.Database.ExecuteNonQueryHelper(DbCommand cmd)\r\n at NPoco.Database.Execute(String sql, CommandType commandType, Object[] args)\r\n at NPoco.Database.Execute(Sql Sql)\r\n at Umbraco.Cms.Persistence.SqlServer.Services.MicrosoftSqlSyntaxProviderBase`1.HandleCreateTable(IDatabase database, TableDefinition tableDefinition, Boolean skipKeysAndIndexes)\r\n at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseSchemaCreator.CreateTable(Boolean overwrite, Type modelType, DatabaseDataCreator dataCreation)\r\n at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseSchemaCreator.InitializeDatabaseSchema()\r\n at Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseBuilder.CreateSchemaAndData(ICoreScope scope)\r\nClientConnectionId:cd1433a5-7737-414a-88d7-7031656031cc\r\nError Number:1911,State:1,Class:16","@tr":"6415db4e0853b4cbb5062270f2d91962","@sp":"8d6f3c4d10545188","SourceContext":"Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseBuilder","ActionId":"0222ec1a-29a3-4563-ac80-30f5bde9af61","ActionName":"Umbraco.Cms.Api.Management.Controllers.Install.SetupInstallController.Setup (Umbraco.Cms.Api.Management)","RequestId":"0HNAAIPS7E0J3:00000291","RequestPath":"/umbraco/management/api/v1/install/setup","ConnectionId":"0HNAAIPS7E0J3","ProcessId":29256,"ProcessName":"Blog","ThreadId":24,"ApplicationId":"08d2dc66a993f76545f5208950d8f826abf544ea","MachineName":"DESKTOP-OVT0GIF","Log4NetLevel":"ERROR","HttpRequestId":"2670c834-c616-4891-9d6b-8ce726271701","HttpRequestNumber":1,"HttpSessionId":"5c46077b-2a40-206b-7ad8-03264bf9a7c8"}
{"@t":"2025-02-11T12:20:40.2872589Z","@mt":"The database schema validation produced the following summary: {DbSchemaSummary}","@tr":"6415db4e0853b4cbb5062270f2d91962","@sp":"8d6f3c4d10545188","DbSchemaSummary":"The following tables were found in the database, but are not in the current schema:\r\numbracoUser,umbracoNode,cmsContentType,cmsTemplate,umbracoContent,umbracoContentVersion,umbracoMediaVersion,umbracoDocument,cmsDocumentType,umbracoDataType,cmsDictionary,umbracoLanguage,cmsLanguageText,umbracoDomain,umbracoLog,cmsMemberType,cmsMember,cmsMember2MemberGroup,cmsPropertyTypeGroup,cmsPropertyType,umbracoPropertyData,umbracoRelationType,umbracoRelation,cmsTags,cmsTagRelationship,cmsContentType2ContentType,cmsContentTypeAllowedContentType,umbracoUser2NodeNotify,umbracoUser2ClientId,umbracoServer,umbracoAccess,umbracoAccessRule,umbracoCacheInstruction,umbracoExternalLogin,umbracoExternalLoginToken,umbracoTwoFactorLogin,umbracoRedirectUrl,umbracoLock,umbracoUserGroup,umbracoUser2UserGroup,umbracoUserGroup2App,umbracoUserGroup2Permission,umbracoUserGroup2GranularPermission,umbracoUserStartNode,cmsContentNu,umbracoDocumentVersion,umbracoDocumentUrl,umbracoKeyValue,umbracoUserLogin,umbracoConsent,umbracoAudit,umbracoContentVersionCultureVariation,umbracoDocumentCultureVariation,umbracoContentSchedule,umbracoLogViewerQuery,umbracoContentVersionCleanupPolicy,umbracoCreatedPackageSchema,umbracoUserGroup2Language,umbracoWebhook,umbracoWebhook2ContentTypeKeys,umbracoWebhook2Events,umbracoWebhook2Headers,umbracoWebhookLog,umbracoWebhookRequest,umbracoUserData\r\n \r\nThe following columns were found in the database, but are not in the current schema:\r\numbracoUser,id,umbracoUser,userDisabled,umbracoUser,key,umbracoUser,userNoConsole,umbracoUser,userName,umbracoUser,userLogin,umbracoUser,userPassword,umbracoUser,passwordConfig,umbracoUser,userEmail,umbracoUser,userLanguage,umbracoUser,securityStampToken,umbracoUser,failedLoginAttempts,umbracoUser,lastLockoutDate,umbracoUser,lastPasswordChangeDate,umbracoUser,lastLoginDate,umbracoUser,emailConfirmedDate,umbracoUser,invitedDate,umbracoUser,createDate,umbracoUser,updateDate,umbracoUser,kind,umbracoUser,avatar,umbracoNode,id,umbracoNode,uniqueId,umbracoNode,parentId,umbracoNode,level,umbracoNode,path,umbracoNode,sortOrder,umbracoNode,trashed,umbracoNode,nodeUser,umbracoNode,text,umbracoNode,nodeObjectType,umbracoNode,createDate,cmsContentType,pk,cmsContentType,nodeId,cmsContentType,alias,cmsContentType,icon,cmsContentType,thumbnail,cmsContentType,description,cmsContentType,listView,cmsContentType,isElement,cmsContentType,allowAtRoot,cmsContentType,variations,cmsTemplate,pk,cmsTemplate,nodeId,cmsTemplate,alias,umbracoContent,nodeId,umbracoContent,contentTypeId,umbracoContentVersion,id,umbracoContentVersion,nodeId,umbracoContentVersion,versionDate,umbracoContentVersion,userId,umbracoContentVersion,current,umbracoContentVersion,text,umbracoContentVersion,preventCleanup,umbracoMediaVersion,id,umbracoMediaVersion,path,umbracoDocument,nodeId,umbracoDocument,published,umbracoDocument,edited,cmsDocumentType,contentTypeNodeId,cmsDocumentType,templateNodeId,cmsDocumentType,IsDefault,umbracoDataType,nodeId,umbracoDataType,propertyEditorAlias,umbracoDataType,propertyEditorUiAlias,umbracoDataType,dbType,umbracoDataType,config,cmsDictionary,pk,cmsDictionary,id,cmsDictionary,parent,cmsDictionary,key,umbracoLanguage,id,umbracoLanguage,languageISOCode,umbracoLanguage,languageCultureName,umbracoLanguage,isDefaultVariantLang,umbracoLanguage,mandatory,umbracoLanguage,fallbackLanguageId,cmsLanguageText,pk,cmsLanguageText,languageId,cmsLanguageText,UniqueId,cmsLanguageText,value,umbracoDomain,id,umbracoDomain,domainDefaultLanguage,umbracoDomain,domainRootStructureID,umbracoDomain,domainName,umbracoDomain,sortOrder,umbracoLog,id,umbracoLog,userId,umbracoLog,NodeId,umbracoLog,entityType,umbracoLog,Datestamp,umbracoLog,logHeader,umbracoLog,logComment,umbracoLog,parameters,cmsMemberType,pk,cmsMemberType,NodeId,cmsMemberType,propertytypeId,cmsMemberType,memberCanEdit,cmsMemberType,viewOnProfile,cmsMemberType,isSensitive,cmsMember,nodeId,cmsMember,Email,cmsMember,LoginName,cmsMember,Password,cmsMember,passwordConfig,cmsMember,securityStampToken,cmsMember,emailConfirmedDate,cmsMember,failedPasswordAttempts,cmsMember,isLockedOut,cmsMember,isApproved,cmsMember,lastLoginDate,cmsMember,lastLockoutDate,cmsMember,lastPasswordChangeDate,cmsMember2MemberGroup,Member,cmsMember2MemberGroup,MemberGroup,cmsPropertyTypeGroup,id,cmsPropertyTypeGroup,uniqueID,cmsPropertyTypeGroup,contenttypeNodeId,cmsPropertyTypeGroup,type,cmsPropertyTypeGroup,text,cmsPropertyTypeGroup,alias,cmsPropertyTypeGroup,sortorder,cmsPropertyType,id,cmsPropertyType,dataTypeId,cmsPropertyType,contentTypeId,cmsPropertyType,propertyTypeGroupId,cmsPropertyType,Alias,cmsPropertyType,Name,cmsPropertyType,sortOrder,cmsPropertyType,mandatory,cmsPropertyType,mandatoryMessage,cmsPropertyType,validationRegExp,cmsPropertyType,validationRegExpMessage,cmsPropertyType,Description,cmsPropertyType,labelOnTop,cmsPropertyType,variations,cmsPropertyType,UniqueID,umbracoPropertyData,id,umbracoPropertyData,versionId,umbracoPropertyData,propertyTypeId,umbracoPropertyData,languageId,umbracoPropertyData,segment,umbracoPropertyData,intValue,umbracoPropertyData,decimalValue,umbracoPropertyData,dateValue,umbracoPropertyData,varcharValue,umbracoPropertyData,textValue,umbracoRelationType,id,umbracoRelationType,typeUniqueId,umbracoRelationType,dual,umbracoRelationType,parentObjectType,umbracoRelationType,childObjectType,umbracoRelationType,name,umbracoRelationType,alias,umbracoRelationType,isDependency,umbracoRelation,id,umbracoRelation,parentId,umbracoRelation,childId,umbracoRelation,relType,umbracoRelation,datetime,umbracoRelation,comment,cmsTags,id,cmsTags,group,cmsTags,languageId,cmsTags,tag,cmsTagRelationship,nodeId,cmsTagRelationship,tagId,cmsTagRelationship,propertyTypeId,cmsContentType2ContentType,parentContentTypeId,cmsContentType2ContentType,childContentTypeId,cmsContentTypeAllowedContentType,Id,cmsContentTypeAllowedContentType,AllowedId,cmsContentTypeAllowedContentType,SortOrder,umbracoUser2NodeNotify,userId,umbracoUser2NodeNotify,nodeId,umbracoUser2NodeNotify,action,umbracoUser2ClientId,userId,umbracoUser2ClientId,clientId,umbracoServer,id,umbracoServer,address,umbracoServer,computerName,umbracoServer,registeredDate,umbracoServer,lastNotifiedDate,umbracoServer,isActive,umbracoServer,isSchedulingPublisher,umbracoAccess,id,umbracoAccess,nodeId,umbracoAccess,loginNodeId,umbracoAccess,noAccessNodeId,umbracoAccess,createDate,umbracoAccess,updateDate,umbracoAccessRule,id,umbracoAccessRule,accessId,umbracoAccessRule,ruleValue,umbracoAccessRule,ruleType,umbracoAccessRule,createDate,umbracoAccessRule,updateDate,umbracoCacheInstruction,id,umbracoCacheInstruction,utcStamp,umbracoCacheInstruction,jsonInstruction,umbracoCacheInstruction,originated,umbracoCacheInstruction,instructionCount,umbracoExternalLogin,id,umbracoExternalLogin,userOrMemberKey,umbracoExternalLogin,loginProvider,umbracoExternalLogin,providerKey,umbracoExternalLogin,createDate,umbracoExternalLogin,userData,umbracoExternalLoginToken,id,umbracoExternalLoginToken,externalLoginId,umbracoExternalLoginToken,name,umbracoExternalLoginToken,value,umbracoExternalLoginToken,createDate,umbracoTwoFactorLogin,id,umbracoTwoFactorLogin,userOrMemberKey,umbracoTwoFactorLogin,providerName,umbracoTwoFactorLogin,secret,umbracoRedirectUrl,id,umbracoRedirectUrl,contentKey,umbracoRedirectUrl,createDateUtc,umbracoRedirectUrl,url,umbracoRedirectUrl,culture,umbracoRedirectUrl,urlHash,umbracoLock,id,umbracoLock,value,umbracoLock,name,umbracoUserGroup,id,umbracoUserGroup,key,umbracoUserGroup,userGroupAlias,umbracoUserGroup,userGroupName,umbracoUserGroup,userGroupDefaultPermissions,umbracoUserGroup,createDate,umbracoUserGroup,updateDate,umbracoUserGroup,icon,umbracoUserGroup,hasAccessToAllLanguages,umbracoUserGroup,startContentId,umbracoUserGroup,startMediaId,umbracoUser2UserGroup,userId,umbracoUser2UserGroup,userGroupId,umbracoUserGroup2App,userGroupId,umbracoUserGroup2App,app,umbracoUserGroup2Permission,id,umbracoUserGroup2Permission,userGroupKey,umbracoUserGroup2Permission,permission,umbracoUserGroup2GranularPermission,id,umbracoUserGroup2GranularPermission,userGroupKey,umbracoUserGroup2GranularPermission,uniqueId,umbracoUserGroup2GranularPermission,permission,umbracoUserGroup2GranularPermission,context,umbracoUserStartNode,id,umbracoUserStartNode,userId,umbracoUserStartNode,startNode,umbracoUserStartNode,startNodeType,cmsContentNu,nodeId,cmsContentNu,published,cmsContentNu,data,cmsContentNu,rv,cmsContentNu,dataRaw,umbracoDocumentVersion,id,umbracoDocumentVersion,templateId,umbracoDocumentVersion,published,umbracoDocumentUrl,id,umbracoDocumentUrl,uniqueId,umbracoDocumentUrl,isDraft,umbracoDocumentUrl,languageId,umbracoDocumentUrl,urlSegment,umbracoKeyValue,key,umbracoKeyValue,value,umbracoKeyValue,updated,umbracoUserLogin,sessionId,umbracoUserLogin,userId,umbracoUserLogin,loggedInUtc,umbracoUserLogin,lastValidatedUtc,umbracoUserLogin,loggedOutUtc,umbracoUserLogin,ipAddress,umbracoConsent,id,umbracoConsent,current,umbracoConsent,source,umbracoConsent,context,umbracoConsent,action,umbracoConsent,createDate,umbracoConsent,state,umbracoConsent,comment,umbracoAudit,id,umbracoAudit,performingUserId,umbracoAudit,performingDetails,umbracoAudit,performingIp,umbracoAudit,eventDateUtc,umbracoAudit,affectedUserId,umbracoAudit,affectedDetails,umbracoAudit,eventType,umbracoAudit,eventDetails,umbracoContentVersionCultureVariation,id,umbracoContentVersionCultureVariation,versionId,umbracoContentVersionCultureVariation,languageId,umbracoContentVersionCultureVariation,name,umbracoContentVersionCultureVariation,date,umbracoContentVersionCultureVariation,availableUserId,umbracoDocumentCultureVariation,id,umbracoDocumentCultureVariation,nodeId,umbracoDocumentCultureVariation,languageId,umbracoDocumentCultureVariation,edited,umbracoDocumentCultureVariation,available,umbracoDocumentCultureVariation,published,umbracoDocumentCultureVariation,name,umbracoContentSchedule,id,umbracoContentSchedule,nodeId,umbracoContentSchedule,languageId,umbracoContentSchedule,date,umbracoContentSchedule,action,umbracoLogViewerQuery,id,umbracoLogViewerQuery,name,umbracoLogViewerQuery,query,umbracoContentVersionCleanupPolicy,contentTypeId,umbracoContentVersionCleanupPolicy,preventCleanup,umbracoContentVersionCleanupPolicy,keepAllVersionsNewerThanDays,umbracoContentVersionCleanupPolicy,keepLatestVersionPerDayForDays,umbracoContentVersionCleanupPolicy,updated,umbracoCreatedPackageSchema,id,umbracoCreatedPackageSchema,name,umbracoCreatedPackageSchema,value,umbracoCreatedPackageSchema,updateDate,umbracoCreatedPackageSchema,packageId,umbracoUserGroup2Language,userGroupId,umbracoUserGroup2Language,languageId,umbracoWebhook,id,umbracoWebhook,key,umbracoWebhook,url,umbracoWebhook,enabled,umbracoWebhook2ContentTypeKeys,webhookId,umbracoWebhook2ContentTypeKeys,entityKey,umbracoWebhook2Events,webhookId,umbracoWebhook2Events,event,umbracoWebhook2Headers,webhookId,umbracoWebhook2Headers,Key,umbracoWebhook2Headers,Value,umbracoWebhookLog,id,umbracoWebhookLog,webhookKey,umbracoWebhookLog,key,umbracoWebhookLog,statusCode,umbracoWebhookLog,date,umbracoWebhookLog,url,umbracoWebhookLog,eventAlias,umbracoWebhookLog,retryCount,umbracoWebhookLog,requestHeaders,umbracoWebhookLog,requestBody,umbracoWebhookLog,responseHeaders,umbracoWebhookLog,responseBody,umbracoWebhookLog,exceptionOccured,umbracoWebhookRequest,id,umbracoWebhookRequest,webhookKey,umbracoWebhookRequest,eventName,umbracoWebhookRequest,requestObject,umbracoWebhookRequest,retryCount,umbracoUserData,key,umbracoUserData,userKey,umbracoUserData,group,umbracoUserData,identifier,umbracoUserData,value\r\n \r\nThe following constraints (Primary Keys, Foreign Keys and Indexes) were found in the database, but are not in the current schema:\r\nFK_umbracoNode_umbracoNode_id,FK_umbracoNode_umbracoUser_id,FK_cmsContentType_umbracoNode_id,FK_cmsTemplate_umbracoNode,FK_umbracoContent_umbracoNode_id,FK_umbracoContent_cmsContentType_NodeId,FK_umbracoContentVersion_umbracoContent_nodeId,FK_umbracoContentVersion_umbracoUser_id,FK_umbracoMediaVersion_umbracoContentVersion_id,FK_umbracoDocument_umbracoContent_nodeId,FK_cmsDocumentType_cmsContentType_nodeId,FK_cmsDocumentType_umbracoNode_id,FK_cmsDocumentType_cmsTemplate_nodeId,FK_umbracoDataType_umbracoNode_id,FK_cmsDictionary_cmsDictionary_id,FK_umbracoLanguage_umbracoLanguage_id,FK_cmsLanguageText_umbracoLanguage_id,FK_cmsLanguageText_cmsDictionary_id,FK_umbracoDomain_umbracoNode_id,FK_umbracoLog_umbracoUser_id,FK_cmsMemberType_umbracoNode_id,FK_cmsMemberType_cmsContentType_nodeId,FK_cmsMember_umbracoContent_nodeId,FK_cmsMember2MemberGroup_cmsMember_nodeId,FK_cmsMember2MemberGroup_umbracoNode_id,FK_cmsPropertyTypeGroup_cmsContentType_nodeId,FK_cmsPropertyType_umbracoDataType_nodeId,FK_cmsPropertyType_cmsContentType_nodeId,FK_cmsPropertyType_cmsPropertyTypeGroup_id,FK_umbracoPropertyData_umbracoContentVersion_id,FK_umbracoPropertyData_cmsPropertyType_id,FK_umbracoPropertyData_umbracoLanguage_id,FK_umbracoRelation_umbracoNode,FK_umbracoRelation_umbracoNode1,FK_umbracoRelation_umbracoRelationType_id,FK_cmsTags_umbracoLanguage_id,FK_cmsTagRelationship_cmsContent,FK_cmsTagRelationship_cmsTags_id,FK_cmsTagRelationship_cmsPropertyType,FK_cmsContentType2ContentType_umbracoNode_parent,FK_cmsContentType2ContentType_umbracoNode_child,FK_cmsContentTypeAllowedContentType_cmsContentType,FK_cmsContentTypeAllowedContentType_cmsContentType1,FK_umbracoUser2NodeNotify_umbracoUser_id,FK_umbracoUser2NodeNotify_umbracoNode_id,FK_umbracoUser2ClientId_umbracoUser_id,FK_umbracoAccess_umbracoNode_id,FK_umbracoAccess_umbracoNode_id1,FK_umbracoAccess_umbracoNode_id2,FK_umbracoAccessRule_umbracoAccess_id,FK_umbracoExternalLoginToken_umbracoExternalLogin_id,FK_umbracoRedirectUrl_umbracoNode_uniqueID,FK_startContentId_umbracoNode_id,FK_startMediaId_umbracoNode_id,FK_umbracoUser2UserGroup_umbracoUser_id,FK_umbracoUser2UserGroup_umbracoUserGroup_id,FK_umbracoUserGroup2App_umbracoUserGroup_id,FK_umbracoUserGroup2Permission_umbracoUserGroup_key,FK_umbracoUserGroup2GranularPermission_umbracoUserGroup_key,FK_umbracoUserGroup2GranularPermission_umbracoNode_uniqueId,FK_umbracoUserStartNode_umbracoUser_id,FK_umbracoUserStartNode_umbracoNode_id,FK_cmsContentNu_umbracoContent_nodeId,FK_umbracoDocumentVersion_umbracoContentVersion_id,FK_umbracoDocumentVersion_cmsTemplate_nodeId,FK_umbracoDocumentUrl_umbracoNode_uniqueId,FK_umbracoDocumentUrl_umbracoLanguage_id,FK_umbracoUserLogin_umbracoUser_id,FK_umbracoContentVersionCultureVariation_umbracoContentVersion_id,FK_umbracoContentVersionCultureVariation_umbracoLanguage_id,FK_umbracoContentVersionCultureVariation_umbracoUser_id,FK_umbracoDocumentCultureVariation_umbracoNode_id,FK_umbracoDocumentCultureVariation_umbracoLanguage_id,FK_umbracoContentSchedule_umbracoContent_nodeId,FK_umbracoContentSchedule_umbracoLanguage_id,FK_umbracoContentVersionCleanupPolicy_cmsContentType_nodeId,FK_umbracoUserGroup2Language_umbracoUserGroup_id,FK_umbracoUserGroup2Language_umbracoLanguage_id,FK_umbracoWebhook2ContentTypeKeys_umbracoWebhook_id,FK_umbracoWebhook2Events_umbracoWebhook_id,FK_umbracoWebhook2Headers_umbracoWebhook_id,FK_umbracoUserData_umbracoUser_key,PK_user,PK_umbracoNode,PK_cmsContentType,PK_cmsTemplate,PK_umbracoContent,PK_umbracoContentVersion,PK_umbracoMediaVersion,PK_umbracoDocument,PK_cmsDocumentType,PK_umbracoDataType,PK_cmsDictionary,PK_umbracoLanguage,PK_cmsLanguageText,PK_umbracoDomain,PK_umbracoLog,PK_cmsMemberType,PK_cmsMember,PK_cmsMember2MemberGroup,PK_cmsPropertyTypeGroup,PK_cmsPropertyType,PK_umbracoPropertyData,PK_umbracoRelationType,PK_umbracoRelation,PK_cmsTags,PK_cmsTagRelationship,PK_cmsContentType2ContentType,PK_cmsContentTypeAllowedContentType,PK_umbracoUser2NodeNotify,PK_umbracoUser2ClientId,PK_umbracoServer,PK_umbracoAccess,PK_umbracoAccessRule,PK_umbracoCacheInstruction,PK_umbracoExternalLogin,PK_umbracoExternalLoginToken,PK_umbracoTwoFactorLogin,PK_umbracoRedirectUrl,PK_umbracoLock,PK_umbracoUserGroup,PK_user2userGroup,PK_userGroup2App,PK_userGroup2Permission,PK_umbracoUserGroup2GranularPermissionDto,PK_userStartNode,PK_cmsContentNu,PK_umbracoDocumentVersion,PK_umbracoDocumentUrl,PK_umbracoKeyValue,PK_umbracoUserLogin,PK_umbracoConsent,PK_umbracoAudit,PK_umbracoContentVersionCultureVariation,PK_umbracoDocumentCultureVariation,PK_umbracoContentSchedule,PK_umbracoLogViewerQuery,PK_umbracoContentVersionCleanupPolicy,PK_umbracoCreatedPackageSchema,PK_userGroup2language,PK_umbracoWebhook,PK_webhookEntityKey2Webhook,PK_webhookEvent2WebhookDto,PK_heaeders2WebhookDto,PK_umbracoWebhookLog,PK_umbracoWebhookRequest,PK_umbracoUserDataDto\r\n \r\nThe following indexes were found in the database, but are not in the current schema:\r\nIX_umbracoUser_userKey,IX_umbracoUser_userLogin,IX_umbracoNode_UniqueId,IX_umbracoNode_parentId_nodeObjectType,IX_umbracoNode_Level,IX_umbracoNode_Path,IX_umbracoNode_ObjectType_trashed_sorted,IX_umbracoNode_Trashed,IX_umbracoNode_ObjectType,IX_cmsContentType,IX_cmsContentType_icon,IX_cmsTemplate_nodeId,IX_umbracoContentVersion_NodeId,IX_umbracoContentVersion_Current,IX_umbracoMediaVersion,IX_umbracoDocument_Published,IX_cmsDictionary_id,IX_cmsDictionary_Parent,IX_cmsDictionary_key,IX_umbracoLanguage_languageISOCode,IX_umbracoLanguage_fallbackLanguageId,IX_cmsLanguageText_languageId,IX_umbracoLog,IX_umbracoLog_datestamp,IX_umbracoLog_datestamp_logheader,IX_cmsMember_LoginName,IX_cmsPropertyTypeGroupUniqueID,IX_cmsPropertyTypeAlias,IX_cmsPropertyTypeUniqueID,IX_umbracoPropertyData_VersionId,IX_umbracoPropertyData_PropertyTypeId,IX_umbracoPropertyData_LanguageId,IX_umbracoPropertyData_Segment,IX_umbracoRelationType_UniqueId,IX_umbracoRelationType_name,IX_umbracoRelationType_alias,IX_umbracoRelation_parentChildType,IX_cmsTags_languageId_group,IX_cmsTags_LanguageId,IX_cmsTags,IX_cmsTagRelationship_tagId_nodeId,IX_computerName,IX_umbracoServer_isActive,IX_umbracoAccess_nodeId,IX_umbracoAccessRule,IX_umbracoExternalLogin_userOrMemberKey,IX_umbracoExternalLogin_LoginProvider,IX_umbracoExternalLogin_ProviderKey,IX_umbracoExternalLoginToken_Name,IX_umbracoTwoFactorLogin_userOrMemberKey,IX_umbracoTwoFactorLogin_ProviderName,IX_umbracoRedirectUrl_culture_hash,IX_umbracoRedirectUrl,IX_umbracoUserGroup_userGroupKey,IX_umbracoUserGroup_userGroupAlias,IX_umbracoUserGroup_userGroupName,IX_umbracoUserGroup2Permission_userGroupKey,IX_umbracoUserGroup2GranularPermissionDto_UserGroupKey_UniqueId,IX_umbracoUserGroup2GranularPermissionDto_UniqueId,IX_umbracoUserStartNode_startNodeType,IX_cmsContentNu_published,IX_umbracoDocumentVersion_id_published,IX_umbracoDocumentVersion_published,IX_umbracoDocumentUrl,IX_umbracoUserLogin_lastValidatedUtc,IX_umbracoContentVersionCultureVariation_VersionId,IX_umbracoContentVersionCultureVariation_LanguageId,IX_umbracoDocumentCultureVariation_NodeId,IX_umbracoDocumentCultureVariation_LanguageId,IX_LogViewerQuery_name,IX_umbracoCreatedPackageSchema_Name,IX_umbracoWebhookLog_date,IX_umbracoUserDataDto_UserKey_Group_Identifier\r\n \r\n","SourceContext":"Umbraco.Cms.Infrastructure.Migrations.Install.DatabaseBuilder","ActionId":"0222ec1a-29a3-4563-ac80-30f5bde9af61","ActionName":"Umbraco.Cms.Api.Management.Controllers.Install.SetupInstallController.Setup (Umbraco.Cms.Api.Management)","RequestId":"0HNAAIPS7E0J3:00000291","RequestPath":"/umbraco/management/api/v1/install/setup","ConnectionId":"0HNAAIPS7E0J3","ProcessId":29256,"ProcessName":"Blog","ThreadId":24,"ApplicationId":"08d2dc66a993f76545f5208950d8f826abf544ea","MachineName":"DESKTOP-OVT0GIF","Log4NetLevel":"INFO ","HttpRequestId":"2670c834-c616-4891-9d6b-8ce726271701","HttpRequestNumber":1,"HttpSessionId":"5c46077b-2a40-206b-7ad8-03264bf9a7c8"}
As you can see the error is:
Database configuration failed","@l":"Error","@x":"Microsoft.Data.SqlClient.SqlException (0x80131904): Column name 'parentID' does not exist in the target table or view.
and DDL script for table is:
Create table:\n {Sql}","@tr":"6415db4e0853b4cbb5062270f2d91962","@sp":"8d6f3c4d10545188","Sql":"CREATE TABLE [umbracoNode] ([id] INTEGER NOT NULL IDENTITY(1,1),
[uniqueId] UniqueIdentifier NOT NULL CONSTRAINT [DF_umbracoNode_uniqueId] DEFAULT (NEWID()),
[*parentId*] INTEGER NOT NULL,
[level] INTEGER NOT NULL,\n[path] NVARCHAR(150) NOT NULL,
[sortOrder] INTEGER NOT NULL,
[trashed] BIT NOT NULL CONSTRAINT [DF_umbracoNode_trashed] DEFAULT ('0'),
[nodeUser] INTEGER NULL,\n[text] NVARCHAR(255) NULL,
[nodeObjectType] UniqueIdentifier NULL,
[createDate] DATETIME NOT NULL CONSTRAINT [DF_umbracoNode_createDate] DEFAULT (GETDATE()))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Please note: at this point we do not support case sensitive collations for SQL Server, even if we fix this, we would still have many other things that don't work in CS collations. Additionally, any plugins and packages you may install will suffer from the same problem, they're not built with case-sensitivity in mind.
That said, if you could look at my updated code suggestion (you forgot the I
in uniqueId
) and accept it, then I think it's fine to fix this (didn't notice it was for the indexes).
But again, please note, that it will probably not be a complete fix for CS collations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see you already committed the change, I'll let the tests complete before merging.
I talked to my colleagues and our guidance here for the future is:
- We don't have our tests checking against case-sensitive collations, this might cause us to easily make new mistakes in the future breaking CS support
- Getting Umbraco the work with CS SQL Server collations is not a priority but we're happy with community contributions
- Personally, I feel like the first additional contribution should be to make sure our tests run against CS collation (I don't actually know how to achieve this)
- As noted before, we're not sure if there's any problems with existing queries but would be happy for contributions fixing those
- As noted before, package support will probably be a problem, so cooperation from package developers will likely be needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, understood. I wonder if you have a documentation page on creating/configuring a database so that I can add a line about supporting only case-insensitive collations? So new users will aware of it. As far as I know, there is only one page dedicated to high-level database configuration: https://docs.umbraco.com/umbraco-cms/reference/configuration/connectionstringssettings and there is no mention about collation at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably add it to the requirements https://docs.umbraco.com/umbraco-cms/fundamentals/setup/requirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @nul800sebastiaan, I just opened a PR on umbraco-docs repo - https://github.com/umbraco/UmbracoDocs/pull/6878/files.
Feel free to close this PR whenever you need to.
Description
When mssql database uses any collation with '_CS' (case-sensitive) modifier some of the migrations not applied. In result first start of an Umbraco are impossible. Please see docs: https://learn.microsoft.com/en-us/sql/relational-databases/collations/collation-and-unicode-support?view=sql-server-ver16
I have changed column names in index setup script so now this issue should be fixed.