View Issue Details

IDProjectCategoryView StatusLast Update
0022063mantisbtdb mssqlpublic2017-02-01 22:47
Reporterobmsch 
Assigned To 
PrioritynormalSeverityblockReproducibilityalways
Status confirmedResolutionopen 
Product Version2.0.0-rc.1 
Target Version1.3.7Fixed in Version 
Summary0022063: Installation on MSSQL fails at step 209
Description

The last step (209) of the installation is failing (might be related to 0021901).

"user_id I UNSIGNED NOTNULL DEFAULT '0'" is the culprit here.

The column is created in step 200 as "user_id I DEFAULT '0'"

An index on that column is created in step 201; because of that index MSSQL doesn't allow the change to NOTNULL in 209.

If I run the install with a modified schema ("I NOTNULL DEFAULT '0'" in step 200) all is Ok.

Additional Information

Initially reported by @obmsch in 0021883:0054518

TagsNo tags attached.

Relationships

related to 0021901 new oracle, schema steps 209 fails 
related to 0021883 closeddregad MSSQL installation fails with BAD ALTER TABLE error 

Activities

MDylan

MDylan

2017-01-05 03:33

reporter   ~0054929

We have the same problem with 2.0.0 stable version, so we can't install it on MSSQL.
Any update for this issue?

BAD
ALTER TABLE mantis_api_token_table DROP CONSTRAINT DFmantis_ap_user07AC1A97
ALTER TABLE mantis_api_token_table ALTER COLUMN user_id INT NOT NULL
ALTER TABLE mantis_api_token_table ADD CONSTRAINT DFmantis_api_token_table__user_id634e DEFAULT 0 FOR user_id
ALTER TABLE mantis_api_token_table DROP CONSTRAINT DFmantis_ap_date08A03ED0
ALTER TABLE mantis_api_token_table ALTER COLUMN date_created INT NOT NULL
ALTER TABLE mantis_api_token_table ADD CONSTRAINT DFmantis_api_token_table__date_created3c6f DEFAULT 1 FOR date_created
ALTER TABLE mantis_api_token_table DROP CONSTRAINT DFmantis_ap_date09946309
ALTER TABLE mantis_api_token_table ALTER COLUMN date_used INT NOT NULL
ALTER TABLE mantis_api_token_table ADD CONSTRAINT DFmantis_api_token_table__date_used3d7c DEFAULT 1 FOR date_used
SQLState: 42000 Error Code: 5074 Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]The index 'idx_user_id_name' is dependent on column 'user_id'. SQLState: 42000 Error Code: 4922 Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]ALTER TABLE ALTER COLUMN user_id failed because one or more objects access this column.

obmsch

obmsch

2017-01-05 05:03

reporter   ~0054936

@MDylan: Is this a new install or an upgrade from an earlier version?

1) New install
Easiest way would be to drop the newly created Mantis DB (SSMS).
After that alter 'schema.php' step(200) as detailed in the description of this issue.
Rerun the installation.

2) Upgrade
a) If possible restore the DB prior to the failed upgrade, fix schema (1) and rerun the upgrade.
b) If not use SSMS to manually apply step(209). This may include dropping the index created
in step(201) beforehand and restoring it afterwards.
In 'config_table' set 'database_version(value)' to '209' (!!!).
Finally rerun the upgrade to complete.

MDylan

MDylan

2017-01-05 08:29

reporter   ~0054940

@obmsch
Thank you, this is helped for me (new install).

Issue History

Date Modified Username Field Change
2016-12-22 08:54 dregad New Issue
2016-12-22 08:54 dregad Relationship added related to 0021901
2016-12-22 08:55 dregad Relationship added related to 0021883
2016-12-22 08:56 dregad Reporter dregad => obmsch
2016-12-22 08:56 dregad Reproducibility have not tried => always
2016-12-22 08:56 dregad Status new => confirmed
2016-12-30 16:24 atrol Target Version 1.3.5 => 1.3.6
2017-01-05 03:33 MDylan Note Added: 0054929
2017-01-05 05:03 obmsch Note Added: 0054936
2017-01-05 08:29 MDylan Note Added: 0054940
2017-02-01 22:47 vboctor Target Version 1.3.6 => 1.3.7