core icon indicating copy to clipboard operation
core copied to clipboard

Startup database not working in MSSQL/Oracle

Open acurionedotcms opened this issue 8 years ago • 2 comments

Trying to startup dotcms using the Starter database in MSSQL, throws error generating multi_tree table. As a result the database is incomplete , and dotcms cannot start because of missing tables

Expected Behavior

All database tables should be created and dotcms starts up correctly.

Current Behavior

Error: [16/02/18 14:54:11:688 CST] FATAL runalways.Task00001LoadSchema: Error: Cannot define PRIMARY KEY constraint on nullable column in table 'multitree'.while trying to execute create table multitree ( child NVARCHAR(36) not null, parent1 NVARCHAR(36) not null, parent2 NVARCHAR(36) not null, relationtype NVARCHAR(64) null, treeorder int null, primary key (child, parent1, parent2, relationtype) ) processed 134 statements com.microsoft.sqlserver.jdbc.SQLServerException: Cannot define PRIMARY KEY constraint on nullable column in table 'multitree'.

Possible Solution

multitree.relationtype should be Not null for MSSQL/Oracle to admit it as Primary Key

Steps to Reproduce (for bugs)

  1. Using latest master
  2. Create new database dotcms in MSSQL
  3. run dotcms

Your Environment

  • dotCMS version used: latest master
  • Browser Name and version:
  • Operating System and version:
  • Application Server and version:
  • Java Brand and version:
  • Database and version: MSSQL Server
  • Application module (if apply):

acurionedotcms avatar Feb 16 '18 21:02 acurionedotcms

Task Task04345ChangeMultiTreePrimaryKey is not needed. Please remove.

Also alter task Task04315UpdateMultiTreePK to alter column relation_type to be not null for every db. @acurionedotcms

dsilvam avatar Feb 20 '18 16:02 dsilvam

Needs work. Dotcms instance starts up correctly however task 4345 is still showing in db with starter data if you run select * from db_version. Win7 Pro SP1 / SQLServer 2012 / Chrome v64 / Tomcat 8 / Java 8 /

shaydotcms avatar Feb 28 '18 00:02 shaydotcms