Symptoms

When you run the installer, you see the following in the log:

Processing aborted. Error while executing SQL command:
-- ALTER TABLE [TST_TASK_TYPE] ADD DEFAULT (0) FOR [TASK_WORKFLOW_ID]; ALTER TABLE [TST_TASK_TYPE] ALTER COLUMN [TASK_WORKFLOW_ID] INT NOT NULL
Messages:
   Cannot insert the value NULL into column 'TASK_WORKFLOW_ID', table 'SpiraTest.dbo.TST_TASK_TYPE'; column does not allow nulls. UPDATE fails.  The statement has been terminated. [System.Data.SqlClient.SqlException]

SQL Messages:
   1: Cannot insert the value NULL into column 'TASK_WORKFLOW_ID', table 'SpiraTest.dbo.TST_TASK_TYPE'; column does not allow nulls. UPDATE fails.
   2: The statement has been terminated.

Solution

Please do the following:

  1. Restore the backup of the v6.x database
  2. Run the SQL commands shown below:
  3. Retry the v6.x upgrade that you were performing

SQL Commands

The following SQL commands should be executed inside SQL Server Management Studio:

UPDATE TST_TASK_TYPE
SET TASK_WORKFLOW_ID = WK.TASK_WORKFLOW_ID
FROM TST_TASK_TYPE TT INNER JOIN TST_TASK_WORKFLOW WK
ON WK.PROJECT_TEMPLATE_ID = TT.PROJECT_TEMPLATE_ID
WHERE TT.TASK_WORKFLOW_ID IS NULL AND WK.IS_DEFAULT = 1

    This SQL command links any orphaned task types with the default task workflow in the appropriate project template: