View Issue Details

IDProjectCategoryView StatusLast Update
0016977mantisbtdb mssqlpublic2015-03-15 19:58
Reporterx6tusAssigned Todregad 
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindows ServerOS Version2008 R2
Product Version1.2.16 
Target Version1.3.0-beta.2Fixed in Version1.3.0-beta.2 
Summary0016977: Brand new database installation fails due to script errors
Description

I have created a new test server for installing a brand new copy of Mantis BT 1.2.16.

On running install.php it with full 'sa' database access to both the 'bugtracker' database and the server, the database installation failed.

The script code is repeated trying to execute the DROP CONSTRAINT command with incorrect syntax:

e.g. line 455:

ALTER TABLE mantis_bug_table DROP CONSTRAINT ;

This is invalid.

This error appears many times in the script.

By removing all of these rows the installation script will execute.

Steps To Reproduce

Create a new DB with MS SQL and try to run my attached script.

TagsNo tags attached.

Activities

x6tus

x6tus

2014-02-16 06:24

reporter  

mssql-create-script.txt (27,492 bytes)
CREATE TABLE mantis_config_table (
config_id                VARCHAR(64) NOT NULL,
project_id               INT DEFAULT 0 NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
access_reqd              INT DEFAULT 0,
type                     INT DEFAULT 90,
value                    TEXT NOT NULL,
                 PRIMARY KEY (config_id, project_id, user_id)
);

CREATE INDEX idx_config ON mantis_config_table (config_id);

CREATE TABLE mantis_bug_file_table (
id                       INT IDENTITY(1,1) NOT NULL,
bug_id                   INT DEFAULT 0 NOT NULL,
title                    VARCHAR(250) DEFAULT '' NOT NULL,
description              VARCHAR(250) DEFAULT '' NOT NULL,
diskfile                 VARCHAR(250) DEFAULT '' NOT NULL,
filename                 VARCHAR(250) DEFAULT '' NOT NULL,
folder                   VARCHAR(250) DEFAULT '' NOT NULL,
filesize                 INT DEFAULT 0 NOT NULL,
file_type                VARCHAR(250) DEFAULT '' NOT NULL,
date_added               DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
content                  IMAGE NOT NULL,
                 PRIMARY KEY (id)
);

CREATE INDEX idx_bug_file_bug_id ON mantis_bug_file_table (bug_id);

CREATE TABLE mantis_bug_history_table (
id                       INT IDENTITY(1,1) NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
bug_id                   INT DEFAULT 0 NOT NULL,
date_modified            DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
field_name               VARCHAR(32) DEFAULT '' NOT NULL,
old_value                VARCHAR(128) DEFAULT '' NOT NULL,
new_value                VARCHAR(128) DEFAULT '' NOT NULL,
type                     SMALLINT DEFAULT 0 NOT NULL,
                 PRIMARY KEY (id)
);

CREATE INDEX idx_bug_history_bug_id ON mantis_bug_history_table (bug_id);

CREATE INDEX idx_history_user_id ON mantis_bug_history_table (user_id);

CREATE TABLE mantis_bug_monitor_table (
user_id                  INT DEFAULT 0 NOT NULL,
bug_id                   INT DEFAULT 0 NOT NULL,
                 PRIMARY KEY (user_id, bug_id)
);

CREATE TABLE mantis_bug_relationship_table (
id                       INT IDENTITY(1,1) NOT NULL,
source_bug_id            INT DEFAULT 0 NOT NULL,
destination_bug_id       INT DEFAULT 0 NOT NULL,
relationship_type        SMALLINT DEFAULT 0 NOT NULL,
                 PRIMARY KEY (id)
);

CREATE INDEX idx_relationship_source ON mantis_bug_relationship_table (source_bug_id);

CREATE INDEX idx_relationship_destination ON mantis_bug_relationship_table (destination_bug_id);

CREATE TABLE mantis_bug_table (
id                       INT IDENTITY(1,1) NOT NULL,
project_id               INT DEFAULT 0 NOT NULL,
reporter_id              INT DEFAULT 0 NOT NULL,
handler_id               INT DEFAULT 0 NOT NULL,
duplicate_id             INT DEFAULT 0 NOT NULL,
priority                 SMALLINT DEFAULT 30 NOT NULL,
severity                 SMALLINT DEFAULT 50 NOT NULL,
reproducibility          SMALLINT DEFAULT 10 NOT NULL,
status                   SMALLINT DEFAULT 10 NOT NULL,
resolution               SMALLINT DEFAULT 10 NOT NULL,
projection               SMALLINT DEFAULT 10 NOT NULL,
category                 VARCHAR(64) DEFAULT '' NOT NULL,
date_submitted           DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
last_updated             DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
eta                      SMALLINT DEFAULT 10 NOT NULL,
bug_text_id              INT DEFAULT 0 NOT NULL,
os                       VARCHAR(32) DEFAULT '' NOT NULL,
os_build                 VARCHAR(32) DEFAULT '' NOT NULL,
platform                 VARCHAR(32) DEFAULT '' NOT NULL,
version                  VARCHAR(64) DEFAULT '' NOT NULL,
fixed_in_version         VARCHAR(64) DEFAULT '' NOT NULL,
build                    VARCHAR(32) DEFAULT '' NOT NULL,
profile_id               INT DEFAULT 0 NOT NULL,
view_state               SMALLINT DEFAULT 10 NOT NULL,
summary                  VARCHAR(128) DEFAULT '' NOT NULL,
sponsorship_total        INT DEFAULT 0 NOT NULL,
sticky                   BIT DEFAULT '0' NOT NULL,
                 PRIMARY KEY (id)
);

CREATE INDEX idx_bug_sponsorship_total ON mantis_bug_table (sponsorship_total);

CREATE INDEX idx_bug_fixed_in_version ON mantis_bug_table (fixed_in_version);

CREATE INDEX idx_bug_status ON mantis_bug_table (status);

CREATE INDEX idx_project ON mantis_bug_table (project_id);

CREATE TABLE mantis_bug_text_table (
id                       INT IDENTITY(1,1) NOT NULL,
description              TEXT NOT NULL,
steps_to_reproduce       TEXT NOT NULL,
additional_information   TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_bugnote_table (
id                       INT IDENTITY(1,1) NOT NULL,
bug_id                   INT DEFAULT 0 NOT NULL,
reporter_id              INT DEFAULT 0 NOT NULL,
bugnote_text_id          INT DEFAULT 0 NOT NULL,
view_state               SMALLINT DEFAULT 10 NOT NULL,
date_submitted           DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
last_modified            DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
note_type                INT DEFAULT 0,
note_attr                VARCHAR(250) DEFAULT '',
                 PRIMARY KEY (id)
);

CREATE INDEX idx_bug ON mantis_bugnote_table (bug_id);

CREATE INDEX idx_last_mod ON mantis_bugnote_table (last_modified);

CREATE TABLE mantis_bugnote_text_table (
id                       INT IDENTITY(1,1) NOT NULL,
note                     TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_custom_field_project_table (
field_id                 INT DEFAULT 0 NOT NULL,
project_id               INT DEFAULT 0 NOT NULL,
sequence                 SMALLINT DEFAULT 0 NOT NULL,
                 PRIMARY KEY (field_id, project_id)
);

CREATE TABLE mantis_custom_field_string_table (
field_id                 INT DEFAULT 0 NOT NULL,
bug_id                   INT DEFAULT 0 NOT NULL,
value                    VARCHAR(255) DEFAULT '' NOT NULL,
                 PRIMARY KEY (field_id, bug_id)
);

CREATE INDEX idx_custom_field_bug ON mantis_custom_field_string_table (bug_id);

CREATE TABLE mantis_custom_field_table (
id                       INT IDENTITY(1,1) NOT NULL,
name                     VARCHAR(64) DEFAULT '' NOT NULL,
type                     SMALLINT DEFAULT 0 NOT NULL,
possible_values          VARCHAR(255) DEFAULT '' NOT NULL,
default_value            VARCHAR(255) DEFAULT '' NOT NULL,
valid_regexp             VARCHAR(255) DEFAULT '' NOT NULL,
access_level_r           SMALLINT DEFAULT 0 NOT NULL,
access_level_rw          SMALLINT DEFAULT 0 NOT NULL,
length_min               INT DEFAULT 0 NOT NULL,
length_max               INT DEFAULT 0 NOT NULL,
advanced                 BIT DEFAULT '0' NOT NULL,
require_report           BIT DEFAULT '0' NOT NULL,
require_update           BIT DEFAULT '0' NOT NULL,
display_report           BIT DEFAULT '0' NOT NULL,
display_update           BIT DEFAULT '1' NOT NULL,
require_resolved         BIT DEFAULT '0' NOT NULL,
display_resolved         BIT DEFAULT '0' NOT NULL,
display_closed           BIT DEFAULT '0' NOT NULL,
require_closed           BIT DEFAULT '0' NOT NULL,
                 PRIMARY KEY (id)
);

CREATE INDEX idx_custom_field_name ON mantis_custom_field_table (name);

CREATE TABLE mantis_filters_table (
id                       INT IDENTITY(1,1) NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
project_id               INT DEFAULT 0 NOT NULL,
is_public                BIT DEFAULT NULL,
name                     VARCHAR(64) DEFAULT '' NOT NULL,
filter_string            TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_news_table (
id                       INT IDENTITY(1,1) NOT NULL,
project_id               INT DEFAULT 0 NOT NULL,
poster_id                INT DEFAULT 0 NOT NULL,
date_posted              DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
last_modified            DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
view_state               SMALLINT DEFAULT 10 NOT NULL,
announcement             BIT DEFAULT '0' NOT NULL,
headline                 VARCHAR(64) DEFAULT '' NOT NULL,
body                     TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_project_category_table (
project_id               INT DEFAULT 0 NOT NULL,
category                 VARCHAR(64) DEFAULT '' NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
                 PRIMARY KEY (project_id, category)
);

CREATE TABLE mantis_project_file_table (
id                       INT IDENTITY(1,1) NOT NULL,
project_id               INT DEFAULT 0 NOT NULL,
title                    VARCHAR(250) DEFAULT '' NOT NULL,
description              VARCHAR(250) DEFAULT '' NOT NULL,
diskfile                 VARCHAR(250) DEFAULT '' NOT NULL,
filename                 VARCHAR(250) DEFAULT '' NOT NULL,
folder                   VARCHAR(250) DEFAULT '' NOT NULL,
filesize                 INT DEFAULT 0 NOT NULL,
file_type                VARCHAR(250) DEFAULT '' NOT NULL,
date_added               DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
content                  IMAGE NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_project_hierarchy_table (
child_id                 INT NOT NULL,
parent_id                INT NOT NULL
);

CREATE TABLE mantis_project_table (
id                       INT IDENTITY(1,1) NOT NULL,
name                     VARCHAR(128) DEFAULT '' NOT NULL,
status                   SMALLINT DEFAULT 10 NOT NULL,
enabled                  BIT DEFAULT '1' NOT NULL,
view_state               SMALLINT DEFAULT 10 NOT NULL,
access_min               SMALLINT DEFAULT 10 NOT NULL,
file_path                VARCHAR(250) DEFAULT '' NOT NULL,
description              TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE INDEX idx_project_id ON mantis_project_table (id);

CREATE UNIQUE INDEX idx_project_name ON mantis_project_table (name);

CREATE INDEX idx_project_view ON mantis_project_table (view_state);

CREATE TABLE mantis_project_user_list_table (
project_id               INT DEFAULT 0 NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
access_level             SMALLINT DEFAULT 10 NOT NULL,
                 PRIMARY KEY (project_id, user_id)
);

CREATE INDEX idx_project_user ON mantis_project_user_list_table (user_id);

CREATE TABLE mantis_project_version_table (
id                       INT IDENTITY(1,1) NOT NULL,
project_id               INT DEFAULT 0 NOT NULL,
version                  VARCHAR(64) DEFAULT '' NOT NULL,
date_order               DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
description              TEXT NOT NULL,
released                 BIT DEFAULT '1' NOT NULL,
                 PRIMARY KEY (id)
);

CREATE UNIQUE INDEX idx_project_version ON mantis_project_version_table (project_id, version);

CREATE TABLE mantis_sponsorship_table (
id                       INT IDENTITY(1,1) NOT NULL,
bug_id                   INT DEFAULT 0 NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
amount                   INT DEFAULT 0 NOT NULL,
logo                     VARCHAR(128) DEFAULT '' NOT NULL,
url                      VARCHAR(128) DEFAULT '' NOT NULL,
paid                     BIT DEFAULT '0' NOT NULL,
date_submitted           DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
last_updated             DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
                 PRIMARY KEY (id)
);

CREATE INDEX idx_sponsorship_bug_id ON mantis_sponsorship_table (bug_id);

CREATE INDEX idx_sponsorship_user_id ON mantis_sponsorship_table (user_id);

CREATE TABLE mantis_tokens_table (
id                       INT IDENTITY(1,1) NOT NULL,
owner                    INT NOT NULL,
type                     INT NOT NULL,
timestamp                DATETIME NOT NULL,
expiry                   DATETIME NULL,
value                    TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_user_pref_table (
id                       INT IDENTITY(1,1) NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
project_id               INT DEFAULT 0 NOT NULL,
default_profile          INT DEFAULT 0 NOT NULL,
default_project          INT DEFAULT 0 NOT NULL,
advanced_report          BIT DEFAULT '0' NOT NULL,
advanced_view            BIT DEFAULT '0' NOT NULL,
advanced_update          BIT DEFAULT '0' NOT NULL,
refresh_delay            INT DEFAULT 0 NOT NULL,
redirect_delay           BIT DEFAULT '0' NOT NULL,
bugnote_order            VARCHAR(4) DEFAULT 'ASC' NOT NULL,
email_on_new             BIT DEFAULT '0' NOT NULL,
email_on_assigned        BIT DEFAULT '0' NOT NULL,
email_on_feedback        BIT DEFAULT '0' NOT NULL,
email_on_resolved        BIT DEFAULT '0' NOT NULL,
email_on_closed          BIT DEFAULT '0' NOT NULL,
email_on_reopened        BIT DEFAULT '0' NOT NULL,
email_on_bugnote         BIT DEFAULT '0' NOT NULL,
email_on_status          BIT DEFAULT '0' NOT NULL,
email_on_priority        BIT DEFAULT '0' NOT NULL,
email_on_priority_min_severity SMALLINT DEFAULT 10 NOT NULL,
email_on_status_min_severity SMALLINT DEFAULT 10 NOT NULL,
email_on_bugnote_min_severity SMALLINT DEFAULT 10 NOT NULL,
email_on_reopened_min_severity SMALLINT DEFAULT 10 NOT NULL,
email_on_closed_min_severity SMALLINT DEFAULT 10 NOT NULL,
email_on_resolved_min_severity SMALLINT DEFAULT 10 NOT NULL,
email_on_feedback_min_severity SMALLINT DEFAULT 10 NOT NULL,
email_on_assigned_min_severity SMALLINT DEFAULT 10 NOT NULL,
email_on_new_min_severity SMALLINT DEFAULT 10 NOT NULL,
email_bugnote_limit      SMALLINT DEFAULT 0 NOT NULL,
language                 VARCHAR(32) DEFAULT 'english' NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_user_print_pref_table (
user_id                  INT DEFAULT 0 NOT NULL,
print_pref               VARCHAR(27) DEFAULT '' NOT NULL,
                 PRIMARY KEY (user_id)
);

CREATE TABLE mantis_user_profile_table (
id                       INT IDENTITY(1,1) NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
platform                 VARCHAR(32) DEFAULT '' NOT NULL,
os                       VARCHAR(32) DEFAULT '' NOT NULL,
os_build                 VARCHAR(32) DEFAULT '' NOT NULL,
description              TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_user_table (
id                       INT IDENTITY(1,1) NOT NULL,
username                 VARCHAR(32) DEFAULT '' NOT NULL,
realname                 VARCHAR(64) DEFAULT '' NOT NULL,
email                    VARCHAR(64) DEFAULT '' NOT NULL,
password                 VARCHAR(32) DEFAULT '' NOT NULL,
date_created             DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
last_visit               DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
enabled                  BIT DEFAULT '1' NOT NULL,
protected                BIT DEFAULT '0' NOT NULL,
access_level             SMALLINT DEFAULT 10 NOT NULL,
login_count              INT DEFAULT 0 NOT NULL,
lost_password_request_count SMALLINT DEFAULT 0 NOT NULL,
failed_login_count       SMALLINT DEFAULT 0 NOT NULL,
cookie_string            VARCHAR(64) DEFAULT '' NOT NULL,
                 PRIMARY KEY (id)
);

CREATE UNIQUE INDEX idx_user_cookie_string ON mantis_user_table (cookie_string);

CREATE UNIQUE INDEX idx_user_username ON mantis_user_table (username);

CREATE INDEX idx_enable ON mantis_user_table (enabled);

CREATE INDEX idx_access ON mantis_user_table (access_level);

INSERT INTO mantis_user_table(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES
        ('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', '2014-02-16 11:13:15', '2014-02-16 11:13:15', '1', '0', 90, 3, 0, 0, 'a2723ffc5977e64aede77284e0ba154cc9a6abff2c29d469efaa9c77c5f0a216');

ALTER TABLE mantis_bug_history_table ALTER COLUMN old_value VARCHAR(255)  NOT NULL;

ALTER TABLE mantis_bug_history_table ALTER COLUMN new_value VARCHAR(255)  NOT NULL;

CREATE TABLE mantis_email_table (
email_id                 INT IDENTITY(1,1) NOT NULL,
email                    VARCHAR(64) DEFAULT '' NOT NULL,
subject                  VARCHAR(250) DEFAULT '' NOT NULL,
submitted                DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
metadata                 TEXT NOT NULL,
body                     TEXT NOT NULL,
                 PRIMARY KEY (email_id)
);

CREATE INDEX idx_email_id ON mantis_email_table (email_id);

ALTER TABLE mantis_bug_table  ADD
 target_version VARCHAR(64) DEFAULT '' NOT NULL;

ALTER TABLE mantis_bugnote_table  ADD
 time_tracking INT DEFAULT 0 NOT NULL;

CREATE INDEX idx_diskfile ON mantis_bug_file_table (diskfile);

ALTER TABLE mantis_user_print_pref_table ALTER COLUMN print_pref VARCHAR(64)  NOT NULL;

ALTER TABLE mantis_bug_history_table ALTER COLUMN field_name VARCHAR(64)  NOT NULL;

CREATE TABLE mantis_tag_table (
id                       INT IDENTITY(1,1) NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
name                     VARCHAR(100) DEFAULT '' NOT NULL,
description              TEXT NOT NULL,
date_created             DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
date_updated             DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
                 PRIMARY KEY (id, name)
);

CREATE TABLE mantis_bug_tag_table (
bug_id                   INT DEFAULT 0 NOT NULL,
tag_id                   INT DEFAULT 0 NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
date_attached            DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
                 PRIMARY KEY (bug_id, tag_id)
);

CREATE INDEX idx_typeowner ON mantis_tokens_table (type, owner);

CREATE TABLE mantis_plugin_table (
basename                 VARCHAR(40) NOT NULL,
enabled                  BIT DEFAULT '0' NOT NULL,
                 PRIMARY KEY (basename)
);

ALTER TABLE mantis_user_pref_table ALTER COLUMN redirect_delay INT;

ALTER TABLE mantis_user_pref_table ADD CONSTRAINT DF__mantis_user_pref_table__redirect_delay__2963 DEFAULT 0 FOR redirect_delay;

ALTER TABLE mantis_user_pref_table ALTER COLUMN redirect_delay INT NOT NULL;

ALTER TABLE mantis_custom_field_table ALTER COLUMN possible_values TEXT;

ALTER TABLE mantis_custom_field_table ADD CONSTRAINT DF__mantis_custom_field_table__possible_values__14b5 DEFAULT '' FOR possible_values;

ALTER TABLE mantis_custom_field_table ALTER COLUMN possible_values TEXT NOT NULL;

CREATE TABLE mantis_category_table (
id                       INT IDENTITY(1,1) NOT NULL,
project_id               INT DEFAULT 0 NOT NULL,
user_id                  INT DEFAULT 0 NOT NULL,
name                     VARCHAR(128) DEFAULT '' NOT NULL,
status                   INT DEFAULT 0 NOT NULL,
                 PRIMARY KEY (id)
);

CREATE UNIQUE INDEX idx_category_project_name ON mantis_category_table (project_id, name);

INSERT INTO mantis_category_table
	( project_id, user_id, name, status ) VALUES
	( '0', '0', 'General', '0' ) ;

ALTER TABLE mantis_bug_table  ADD
 category_id INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bug_table DROP CONSTRAINT ;

ALTER TABLE mantis_bug_table
 DROP COLUMN category;

DROP TABLE mantis_project_category_table;

ALTER TABLE mantis_project_table  ADD
 category_id INT DEFAULT 1 NOT NULL;

INSERT INTO mantis_plugin_table
	( basename, enabled ) VALUES
	( 'MantisCoreFormatting', '1' );

ALTER TABLE mantis_project_table  ADD
 inherit_global INT DEFAULT 0 NOT NULL;

ALTER TABLE mantis_project_hierarchy_table  ADD
 inherit_parent INT DEFAULT 0 NOT NULL;

ALTER TABLE mantis_plugin_table  ADD
 protected BIT DEFAULT '0' NOT NULL, 
 priority INT DEFAULT 3 NOT NULL;

ALTER TABLE mantis_project_version_table  ADD
 obsolete BIT DEFAULT '0' NOT NULL;

ALTER TABLE mantis_bug_table  ADD
 due_date DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL;

ALTER TABLE mantis_custom_field_table  ADD
 filter_by BIT DEFAULT '1' NOT NULL;

CREATE TABLE mantis_bug_revision_table (
id                       INT IDENTITY(1,1) NOT NULL,
bug_id                   INT NOT NULL,
bugnote_id               INT DEFAULT 0 NOT NULL,
user_id                  INT NOT NULL,
timestamp                DATETIME DEFAULT '1970-01-01 02:00:01' NOT NULL,
type                     INT NOT NULL,
value                    TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE INDEX idx_bug_rev_id_time ON mantis_bug_revision_table (bug_id, timestamp);

CREATE INDEX idx_bug_rev_type ON mantis_bug_revision_table (type);

ALTER TABLE mantis_bug_table  ADD
 date_submitted_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bug_table  ADD
 due_date_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bug_table  ADD
 last_updated_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bug_table DROP CONSTRAINT ;

ALTER TABLE mantis_bug_table
 DROP COLUMN date_submitted;

EXEC sp_rename 'mantis_bug_table.date_submitted_int','date_submitted';

ALTER TABLE mantis_bug_table DROP CONSTRAINT ;

ALTER TABLE mantis_bug_table
 DROP COLUMN due_date;

EXEC sp_rename 'mantis_bug_table.due_date_int','due_date';

ALTER TABLE mantis_bug_table DROP CONSTRAINT ;

ALTER TABLE mantis_bug_table
 DROP COLUMN last_updated;

EXEC sp_rename 'mantis_bug_table.last_updated_int','last_updated';

ALTER TABLE mantis_bugnote_table  ADD
 last_modified_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bugnote_table  ADD
 date_submitted_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bugnote_table DROP CONSTRAINT ;

ALTER TABLE mantis_bugnote_table
 DROP COLUMN last_modified;

EXEC sp_rename 'mantis_bugnote_table.last_modified_int','last_modified';

CREATE INDEX idx_last_mod ON mantis_bugnote_table (last_modified);

ALTER TABLE mantis_bugnote_table DROP CONSTRAINT ;

ALTER TABLE mantis_bugnote_table
 DROP COLUMN date_submitted;

EXEC sp_rename 'mantis_bugnote_table.date_submitted_int','date_submitted';

ALTER TABLE mantis_bug_file_table  ADD
 date_added_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bug_file_table DROP CONSTRAINT ;

ALTER TABLE mantis_bug_file_table
 DROP COLUMN date_added;

EXEC sp_rename 'mantis_bug_file_table.date_added_int','date_added';

ALTER TABLE mantis_project_file_table  ADD
 date_added_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_project_file_table DROP CONSTRAINT ;

ALTER TABLE mantis_project_file_table
 DROP COLUMN date_added;

EXEC sp_rename 'mantis_project_file_table.date_added_int','date_added';

ALTER TABLE mantis_bug_history_table  ADD
 date_modified_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bug_history_table DROP CONSTRAINT ;

ALTER TABLE mantis_bug_history_table
 DROP COLUMN date_modified;

EXEC sp_rename 'mantis_bug_history_table.date_modified_int','date_modified';

ALTER TABLE mantis_user_table  ADD
 last_visit_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_user_table  ADD
 date_created_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_user_table DROP CONSTRAINT ;

ALTER TABLE mantis_user_table
 DROP COLUMN date_created;

EXEC sp_rename 'mantis_user_table.date_created_int','date_created';

ALTER TABLE mantis_user_table DROP CONSTRAINT ;

ALTER TABLE mantis_user_table
 DROP COLUMN last_visit;

EXEC sp_rename 'mantis_user_table.last_visit_int','last_visit';

ALTER TABLE mantis_email_table  ADD
 submitted_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_email_table DROP CONSTRAINT ;

ALTER TABLE mantis_email_table
 DROP COLUMN submitted;

EXEC sp_rename 'mantis_email_table.submitted_int','submitted';

ALTER TABLE mantis_tag_table  ADD
 date_created_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_tag_table  ADD
 date_updated_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_tag_table DROP CONSTRAINT ;

ALTER TABLE mantis_tag_table
 DROP COLUMN date_created;

EXEC sp_rename 'mantis_tag_table.date_created_int','date_created';

ALTER TABLE mantis_tag_table DROP CONSTRAINT ;

ALTER TABLE mantis_tag_table
 DROP COLUMN date_updated;

EXEC sp_rename 'mantis_tag_table.date_updated_int','date_updated';

ALTER TABLE mantis_bug_tag_table  ADD
 date_attached_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bug_tag_table DROP CONSTRAINT ;

ALTER TABLE mantis_bug_tag_table
 DROP COLUMN date_attached;

EXEC sp_rename 'mantis_bug_tag_table.date_attached_int','date_attached';

ALTER TABLE mantis_tokens_table  ADD
 timestamp_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_tokens_table  ADD
 expiry_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_tokens_table DROP CONSTRAINT ;

ALTER TABLE mantis_tokens_table
 DROP COLUMN timestamp;

EXEC sp_rename 'mantis_tokens_table.timestamp_int','timestamp';

ALTER TABLE mantis_tokens_table DROP CONSTRAINT ;

ALTER TABLE mantis_tokens_table
 DROP COLUMN expiry;

EXEC sp_rename 'mantis_tokens_table.expiry_int','expiry';

ALTER TABLE mantis_news_table  ADD
 last_modified_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_news_table  ADD
 date_posted_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_news_table DROP CONSTRAINT ;

ALTER TABLE mantis_news_table
 DROP COLUMN last_modified;

EXEC sp_rename 'mantis_news_table.last_modified_int','last_modified';

ALTER TABLE mantis_news_table DROP CONSTRAINT ;

ALTER TABLE mantis_news_table
 DROP COLUMN date_posted;

EXEC sp_rename 'mantis_news_table.date_posted_int','date_posted';

ALTER TABLE mantis_bug_revision_table  ADD
 timestamp_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_bug_revision_table DROP CONSTRAINT ;

ALTER TABLE mantis_bug_revision_table
 DROP COLUMN timestamp;

EXEC sp_rename 'mantis_bug_revision_table.timestamp_int','timestamp';

CREATE INDEX idx_bug_rev_id_time ON mantis_bug_revision_table (bug_id, timestamp);

ALTER TABLE mantis_user_pref_table  ADD
 timezone VARCHAR(32) DEFAULT '' NOT NULL;

ALTER TABLE mantis_project_version_table  ADD
 date_order_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_project_version_table DROP CONSTRAINT ;

ALTER TABLE mantis_project_version_table
 DROP COLUMN date_order;

EXEC sp_rename 'mantis_project_version_table.date_order_int','date_order';

ALTER TABLE mantis_sponsorship_table  ADD
 date_submitted_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_sponsorship_table  ADD
 last_updated_int INT DEFAULT 1 NOT NULL;

ALTER TABLE mantis_sponsorship_table DROP CONSTRAINT ;

ALTER TABLE mantis_sponsorship_table
 DROP COLUMN last_updated;

EXEC sp_rename 'mantis_sponsorship_table.last_updated_int','last_updated';

ALTER TABLE mantis_sponsorship_table DROP CONSTRAINT ;

ALTER TABLE mantis_sponsorship_table
 DROP COLUMN date_submitted;

EXEC sp_rename 'mantis_sponsorship_table.date_submitted_int','date_submitted';

ALTER TABLE mantis_project_file_table  ADD
 user_id INT DEFAULT 0 NOT NULL;

ALTER TABLE mantis_bug_file_table  ADD
 user_id INT DEFAULT 0 NOT NULL;

ALTER TABLE mantis_custom_field_table DROP CONSTRAINT ;

ALTER TABLE mantis_custom_field_table
 DROP COLUMN advanced;

ALTER TABLE mantis_user_pref_table DROP CONSTRAINT ;

ALTER TABLE mantis_user_pref_table
 DROP COLUMN advanced_report;

ALTER TABLE mantis_user_pref_table DROP CONSTRAINT ;

ALTER TABLE mantis_user_pref_table
 DROP COLUMN advanced_view;

ALTER TABLE mantis_user_pref_table DROP CONSTRAINT ;

ALTER TABLE mantis_user_pref_table
 DROP COLUMN advanced_update;

CREATE INDEX idx_project_hierarchy_child_id ON mantis_project_hierarchy_table (child_id);

CREATE INDEX idx_project_hierarchy_parent_id ON mantis_project_hierarchy_table (parent_id);

CREATE INDEX idx_tag_name ON mantis_tag_table (name);

CREATE INDEX idx_bug_tag_tag_id ON mantis_bug_tag_table (tag_id);

INSERT INTO mantis_config_table ( value, type, access_reqd, config_id, project_id, user_id ) VALUES ('183', 1, 90, 'database_version', 0, 0 );

mssql-create-script.txt (27,492 bytes)
grangeway

grangeway

2014-02-17 13:23

reporter   ~0039430

Marking as Suspended

MSSQL support is currently known broken. We are going to be replacing the DB Layer in Mantis to fix this properly after the next release.

I'd strongly advise using MYSQL for now.

The new DB layer already contains the appropriate fixes for MS SQL Support.

grangeway

grangeway

2014-03-27 19:12

reporter   ~0039755

MSSQL support is currently known broken. We are going to be replacing the DB Layer in Mantis to fix this properly after the next release.

I'd strongly advise using MYSQL for now.

The new DB layer already contains the appropriate fixes for MS SQL Support.

grangeway

grangeway

2014-05-16 15:00

reporter   ~0040319

MantisBT currently supports Mysql and has support for other database engines.

The support for other databases is known to be problematic.

Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer.

If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org

In the meantime, I'd advise running Mantis with Mysql Only to avoid issues.

Thanks
Paul

dregad

dregad

2015-03-14 14:02

developer   ~0049227

Despite the fact that I am not actually able to test whether the problem is truly resolved since I don't have access to a MSSQL server setup, I'm marking this issue as fixed in 1.3.x on the grounds that the recent updates in ADOdb (which contain many improvements in the MSSQL driver) are likely to address it.

Should the problem persist (using a nightly build or a version > 1.3.0-beta.1), feel free to reopen this issue or to create a new one.

Issue History

Date Modified Username Field Change
2014-02-16 06:24 x6tus New Issue
2014-02-16 06:24 x6tus File Added: mssql-create-script.txt
2014-02-17 13:23 grangeway Note Added: 0039430
2014-02-17 13:23 grangeway Status new => resolved
2014-02-17 13:23 grangeway Resolution open => suspended
2014-02-17 13:23 grangeway Assigned To => grangeway
2014-02-17 14:55 atrol Status resolved => new
2014-03-27 19:12 grangeway Note Added: 0039755
2014-03-27 19:12 grangeway Status new => resolved
2014-03-28 04:18 atrol Status resolved => assigned
2014-04-12 19:33 grangeway Target Version => 1.3.0-beta.1
2014-05-16 15:00 grangeway Note Added: 0040319
2014-05-23 15:08 grangeway Project mantisbt => @24@
2014-11-07 14:38 atrol Assigned To grangeway =>
2014-11-07 14:38 atrol Status assigned => new
2014-11-07 14:38 atrol Project @24@ => mantisbt
2014-12-08 02:10 atrol Target Version 1.3.0-beta.1 => 1.3.0-beta.2
2015-03-14 14:02 dregad Note Added: 0049227
2015-03-14 14:02 dregad Status new => resolved
2015-03-14 14:02 dregad Fixed in Version => 1.3.0-beta.2
2015-03-14 14:02 dregad Resolution suspended => fixed
2015-03-14 14:02 dregad Assigned To => dregad
2015-03-15 19:58 dregad Status resolved => closed