View Issue Details

IDProjectCategoryView StatusLast Update
0022551mantisbtdb postgresqlpublic2017-12-30 18:36
Reportercepino Assigned Todregad  
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionno change required 
PlatformPostgreSQL 9.6.2, PHP 7.1.3OSSUSE Linux, IIS10 
Product Version2.2.1 
Summary0022551: ERROR: date/time field value out of range
Description

What datestyle Mantis required for the proper functioning of PostgreSQL? Queries working with a column of type timestamp forwarded number. PostgreSQL does not automatically cast to timestamp without time zone.

Steps To Reproduce

1) Create clean database
CREATE DATABASE mantisbt_test
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
CONNECTION LIMIT = -1;
2) Create role and grants default privileges to tables, views, ...
3) Run MantisBT CREATE script (copy text from install.php to pgAdmin query console and run script)
4) Login to MantisBT in UI

Additional Information

Full error report:

APPLICATION ERROR 0000401

DB Query error. Error from DB #-1: ERROR: date/time field value out of range: "1490025497"
HINT: Perhaps you need a different "datestyle" setting. pro dotaz DELETE FROM mantis_tokens_table WHERE $1 > expiry.

Full path: D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\core\database_api.php
Line: 398
Variable Value Type
p_query DELETE FROM mantis_tokens_table WHERE $1 > expiry string
p_limit -1 integer
p_offset -1 integer
p_pop_param 1 boolean
g_db_log_queries boolean
t_db_type pgsql string
s_check_params 1 boolean
t_start 1490025497.7152 double
t_params 1 integer
i 1 integer
sprefix mantis string
s_suffix _table string
t_result boolean
t_elapsed 0.0005 string
t_query_text string

p_arr_parms
Variable Value Type
0 1490025497 integer

g_queries_array
Variable Value Type

1
Variable Value Type
0 string
1 0.0010 string

2
Variable Value Type
0 string
1 0.0008 string

3
Variable Value Type
0 string
1 0.0006 string

4
Variable Value Type
0 string
1 0.0005 string

Filename Line Function Args
D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\core\database_api.php 398 - - trigger_error ( <string>'401', <integer>256 )
D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\core\tokens_api.php 254 - - db_query ( <string>'DELETE FROM mantis_tokens_table WHERE $1 > expiry', <array> { [0] => 1490025497 } )
D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\core\tokens_api.php 269 - - token_purge_expired -
D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\core\tokens_api.php 78 - - token_purge_expired_once -
D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\core\tokens_api.php 102 - - token_get ( <integer>5, <NULL>NULL )
D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\core\collapse_api.php 195 - - token_get_value ( <integer>5 )
D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\core.php 265 - - collapse_cache_token -
D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\my_view_page.php 41 - - require_once ( <string>'D:\Inetpub\wwwroot\ExternalSite\mantisbt_new\core.php' )

TagsNo tags attached.
Attached Files

Activities

atrol

atrol

2017-03-20 15:30

developer   ~0056132

3) Run MantisBT CREATE script (copy text from install.php to pgAdmin query console and run script)

I don't expect that this would work as not all statements in installation process are logged.

Does running the installation script without enabling the check box to print SQL-statements work?

cepino

cepino

2017-03-20 19:04

reporter   ~0056134

The attached script was run. Attached file was created using copy of SQL commands from a browser and comment the invalid commands. I tested directly create a database by running the install.php. The result is a fully functional. Thank you for the advice. Note of the incomplete listing of SQL commands would be a good supplement to the manual.

mantisbt_2.2.1.sql.zip (4,173 bytes)
ddave

ddave

2017-12-20 14:21

reporter   ~0058429

We have the same problem, I attach the installation HTML with the queries executed when installing

Administration - Installation - MantisBT(1).html (41,775 bytes)   
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Administration - Installation - MantisBT</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/default.css" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/status_config.php?cache_key=952532f744e30642da8555a626391c89" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/dropzone-4.3.0.min.css" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/bootstrap-3.3.6.min.css" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/font-awesome-4.6.3.min.css" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/open-sans.css" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/bootstrap-datetimepicker-4.17.47.min.css" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/ace.min.css" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/ace-mantis.css" />
	<link rel="stylesheet" type="text/css" href="https://tareas.utu.edu.uy/css/ace-skins.min.css" />

	<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
	<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: Búsqueda de texto completo" href="https://tareas.utu.edu.uy/browser_search_plugin.php?type=text"/>
	<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: buscar por ID de incidencia" href="https://tareas.utu.edu.uy/browser_search_plugin.php?type=id"/>
	<script type="text/javascript" src="/javascript_config.php?cache_key=952532f744e30642da8555a626391c89"></script>
	<script type="text/javascript" src="/javascript_translations.php?cache_key=b088b3b482a94862a292fbf96396428c"></script>
	<script type="text/javascript" src="/js/jquery-2.2.4.min.js"></script>
	<script type="text/javascript" src="/js/dropzone-4.3.0.min.js"></script>
	<script type="text/javascript" src="/js/common.js"></script>
	<script type="text/javascript" src="/js/install.js"></script>
</head>
<body class="skin-3">
<div id="navbar" class="navbar navbar-default navbar-collapse navbar-fixed-top noprint"><div id="navbar-container" class="navbar-container"><button id="menu-toggler" type="button" class="navbar-toggle menu-toggler pull-left hidden-lg hidden-md" data-target="#sidebar"><span class="sr-only">Toggle sidebar</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><div class="navbar-header"><a href="my_view_page.php" class="navbar-brand"><span class="smaller-75"> MantisBT </span></a><button type="button" class="navbar-toggle navbar-toggle collapsed pull-right hidden-sm hidden-md hidden-lg" data-toggle="collapse" data-target=".navbar-buttons,.navbar-menu"><span class="sr-only">Toggle user menu</span></button></div><div class="navbar-buttons navbar-header navbar-collapse collapse"><ul class="nav ace-nav"></ul></div></div></div><div class="main-container" id="main-container">
<div class="col-md-12 col-xs-12">
	<div class="space-10"></div>

	<div class="page-header">
	<h1>
		Check and Install Database		<div class="btn-group pull-right">
			<a class="btn btn-sm btn-primary btn-white btn-round" href="index.php">Back to Administration</a>
		</div>
	</h1>
	</div>
</div>
<div class="col-md-12 col-xs-12">
<div class="space-10"></div>

<div class="widget-box widget-color-blue2">
<div class="widget-header widget-header-small">
	<h4 class="widget-title lighter">
		Checking Installation
	</h4>
</div>

<div class="widget-body">
<div class="widget-main no-padding">
<div class="table-responsive">
<table class="table table-bordered table-condensed">

<!-- Checking DB support-->
<tr><td>Setting Database Type</td><td class="success">GOOD</td></tr>
<tr><td>Checking PHP support for database type</td><td class="success">GOOD</td></tr>
<tr><td>Checking ADOdb Library version is at least 5.20.2</td><td class="success">GOOD</td></tr>
<tr><td>Setting Database Hostname</td><td class="success">GOOD</td></tr>
<tr><td>Setting Database Username</td><td class="success">GOOD</td></tr>
<tr><td>Setting Database Password</td><td class="success">GOOD</td></tr>
<tr><td>Setting Database Name</td><td class="success">GOOD</td></tr>
<tr>
	<td>
		Setting Admin Username
	</td>
	<td class="success">GOOD</td></tr>
<tr>
	<td>
		Setting Admin Password
	</td>
	<td class="success">GOOD</td></tr>

<!-- connect to db -->
<tr>
	<td>
		Attempting to connect to database as admin
	</td>
	<td class="success">GOOD</td></tr>

</table>
</table>
</div>
</div>
</div>
</div>
</div>

<div class="col-md-12 col-xs-12">
<div class="space-10"></div>
<div class="widget-box widget-color-blue2">
<div class="widget-header widget-header-small">
	<h4 class="widget-title lighter">
		Installing Database
	</h4>
</div>
<div class="widget-body">
<div class="widget-main no-padding">
<div class="table-responsive">
<table class="table table-bordered table-condensed" style="table-layout:fixed">
<tr><td> <span class="bigger-120">Database Creation Suppressed, SQL Queries follow</span> <pre>CREATE TABLE mantis_config_table (
config_id                VARCHAR(64) NOT NULL,
project_id               INTEGER DEFAULT 0 NOT NULL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
access_reqd              INTEGER DEFAULT 0,
type                     INTEGER 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                       SERIAL,
bug_id                   INTEGER 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                 INTEGER DEFAULT 0 NOT NULL,
file_type                VARCHAR(250) DEFAULT '' NOT NULL,
date_added               TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
content                  BYTEA,
                 PRIMARY KEY (id)
);

CREATE INDEX idx_bug_file_bug_id ON mantis_bug_file_table (bug_id);

CREATE TABLE mantis_bug_history_table (
id                       SERIAL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
bug_id                   INTEGER DEFAULT 0 NOT NULL,
date_modified            TIMESTAMP DEFAULT '1970-01-01 00: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                     INT2 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                  INTEGER DEFAULT 0 NOT NULL,
bug_id                   INTEGER DEFAULT 0 NOT NULL,
                 PRIMARY KEY (user_id, bug_id)
);

CREATE TABLE mantis_bug_relationship_table (
id                       SERIAL,
source_bug_id            INTEGER DEFAULT 0 NOT NULL,
destination_bug_id       INTEGER DEFAULT 0 NOT NULL,
relationship_type        INT2 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                       SERIAL,
project_id               INTEGER DEFAULT 0 NOT NULL,
reporter_id              INTEGER DEFAULT 0 NOT NULL,
handler_id               INTEGER DEFAULT 0 NOT NULL,
duplicate_id             INTEGER DEFAULT 0 NOT NULL,
priority                 INT2 DEFAULT 30 NOT NULL,
severity                 INT2 DEFAULT 50 NOT NULL,
reproducibility          INT2 DEFAULT 10 NOT NULL,
status                   INT2 DEFAULT 10 NOT NULL,
resolution               INT2 DEFAULT 10 NOT NULL,
projection               INT2 DEFAULT 10 NOT NULL,
category                 VARCHAR(64) DEFAULT '' NOT NULL,
date_submitted           TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
last_updated             TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
eta                      INT2 DEFAULT 10 NOT NULL,
bug_text_id              INTEGER 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               INTEGER DEFAULT 0 NOT NULL,
view_state               INT2 DEFAULT 10 NOT NULL,
summary                  VARCHAR(128) DEFAULT '' NOT NULL,
sponsorship_total        INTEGER DEFAULT 0 NOT NULL,
sticky                   BOOLEAN 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                       SERIAL,
description              TEXT NOT NULL,
steps_to_reproduce       TEXT NOT NULL,
additional_information   TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_bugnote_table (
id                       SERIAL,
bug_id                   INTEGER DEFAULT 0 NOT NULL,
reporter_id              INTEGER DEFAULT 0 NOT NULL,
bugnote_text_id          INTEGER DEFAULT 0 NOT NULL,
view_state               INT2 DEFAULT 10 NOT NULL,
date_submitted           TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
last_modified            TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
note_type                INTEGER 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                       SERIAL,
note                     TEXT NOT NULL,
                 PRIMARY KEY (id)
);

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

CREATE TABLE mantis_custom_field_string_table (
field_id                 INTEGER DEFAULT 0 NOT NULL,
bug_id                   INTEGER 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                       SERIAL,
name                     VARCHAR(64) DEFAULT '' NOT NULL,
type                     INT2 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           INT2 DEFAULT 0 NOT NULL,
access_level_rw          INT2 DEFAULT 0 NOT NULL,
length_min               INTEGER DEFAULT 0 NOT NULL,
length_max               INTEGER DEFAULT 0 NOT NULL,
advanced                 BOOLEAN DEFAULT '0' NOT NULL,
require_report           BOOLEAN DEFAULT '0' NOT NULL,
require_update           BOOLEAN DEFAULT '0' NOT NULL,
display_report           BOOLEAN DEFAULT '0' NOT NULL,
display_update           BOOLEAN DEFAULT '1' NOT NULL,
require_resolved         BOOLEAN DEFAULT '0' NOT NULL,
display_resolved         BOOLEAN DEFAULT '0' NOT NULL,
display_closed           BOOLEAN DEFAULT '0' NOT NULL,
require_closed           BOOLEAN 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                       SERIAL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
project_id               INTEGER DEFAULT 0 NOT NULL,
is_public                BOOLEAN DEFAULT NULL,
name                     VARCHAR(64) DEFAULT '' NOT NULL,
filter_string            TEXT NOT NULL,
                 PRIMARY KEY (id)
);

CREATE TABLE mantis_news_table (
id                       SERIAL,
project_id               INTEGER DEFAULT 0 NOT NULL,
poster_id                INTEGER DEFAULT 0 NOT NULL,
date_posted              TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
last_modified            TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
view_state               INT2 DEFAULT 10 NOT NULL,
announcement             BOOLEAN 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               INTEGER DEFAULT 0 NOT NULL,
category                 VARCHAR(64) DEFAULT '' NOT NULL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
                 PRIMARY KEY (project_id, category)
);

CREATE TABLE mantis_project_file_table (
id                       SERIAL,
project_id               INTEGER 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                 INTEGER DEFAULT 0 NOT NULL,
file_type                VARCHAR(250) DEFAULT '' NOT NULL,
date_added               TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
content                  BYTEA,
                 PRIMARY KEY (id)
);

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

CREATE TABLE mantis_project_table (
id                       SERIAL,
name                     VARCHAR(128) DEFAULT '' NOT NULL,
status                   INT2 DEFAULT 10 NOT NULL,
enabled                  BOOLEAN DEFAULT '1' NOT NULL,
view_state               INT2 DEFAULT 10 NOT NULL,
access_min               INT2 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               INTEGER DEFAULT 0 NOT NULL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
access_level             INT2 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                       SERIAL,
project_id               INTEGER DEFAULT 0 NOT NULL,
version                  VARCHAR(64) DEFAULT '' NOT NULL,
date_order               TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
description              TEXT NOT NULL,
released                 BOOLEAN 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                       SERIAL,
bug_id                   INTEGER DEFAULT 0 NOT NULL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
amount                   INTEGER DEFAULT 0 NOT NULL,
logo                     VARCHAR(128) DEFAULT '' NOT NULL,
url                      VARCHAR(128) DEFAULT '' NOT NULL,
paid                     BOOLEAN DEFAULT '0' NOT NULL,
date_submitted           TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
last_updated             TIMESTAMP DEFAULT '1970-01-01 00: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                       SERIAL,
owner                    INTEGER NOT NULL,
type                     INTEGER NOT NULL,
timestamp                TIMESTAMP NOT NULL,
expiry                   TIMESTAMP,
value                    TEXT NOT NULL,
                 PRIMARY KEY (id)
);

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

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

CREATE TABLE mantis_user_profile_table (
id                       SERIAL,
user_id                  INTEGER 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                       SERIAL,
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             TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
last_visit               TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
enabled                  BOOLEAN DEFAULT '1' NOT NULL,
protected                BOOLEAN DEFAULT '0' NOT NULL,
access_level             INT2 DEFAULT 10 NOT NULL,
login_count              INTEGER DEFAULT 0 NOT NULL,
lost_password_request_count INT2 DEFAULT 0 NOT NULL,
failed_login_count       INT2 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',
		'2017-12-06 11:43:52', '2017-12-06 11:43:52', '1', '0', 90,
		3, 0, 0, '56313e41939302888d28508222981bb3ddb8d8c2c35cd6502d32d47e0b6e09fd'
	);

CREATE TABLE mantis_email_table (
email_id                 SERIAL,
email                    VARCHAR(64) DEFAULT '' NOT NULL,
subject                  VARCHAR(250) DEFAULT '' NOT NULL,
submitted                TIMESTAMP DEFAULT '1970-01-01 00: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 COLUMN target_version VARCHAR(64)  ;

UPDATE mantis_bug_table SET target_version='';

ALTER TABLE mantis_bug_table ALTER COLUMN target_version SET DEFAULT '';

ALTER TABLE mantis_bug_table ALTER COLUMN target_version SET NOT NULL;

ALTER TABLE mantis_bugnote_table ADD COLUMN time_tracking INTEGER  ;

UPDATE mantis_bugnote_table SET time_tracking=0;

ALTER TABLE mantis_bugnote_table ALTER COLUMN time_tracking SET DEFAULT 0;

ALTER TABLE mantis_bugnote_table ALTER COLUMN time_tracking SET NOT NULL;

CREATE INDEX idx_diskfile ON mantis_bug_file_table (diskfile);

CREATE TABLE mantis_tag_table (
id                       SERIAL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
name                     VARCHAR(100) DEFAULT '' NOT NULL,
description              TEXT NOT NULL,
date_created             TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
date_updated             TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
                 PRIMARY KEY (id, name)
);

CREATE TABLE mantis_bug_tag_table (
bug_id                   INTEGER DEFAULT 0 NOT NULL,
tag_id                   INTEGER DEFAULT 0 NOT NULL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
date_attached            TIMESTAMP DEFAULT '1970-01-01 00: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                  BOOLEAN DEFAULT '0' NOT NULL,
                 PRIMARY KEY (basename)
);

CREATE TABLE mantis_category_table (
id                       SERIAL,
project_id               INTEGER DEFAULT 0 NOT NULL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
name                     VARCHAR(128) DEFAULT '' NOT NULL,
status                   INTEGER 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 COLUMN category_id INTEGER  ;

UPDATE mantis_bug_table SET category_id=1;

ALTER TABLE mantis_bug_table ALTER COLUMN category_id SET DEFAULT 1;

ALTER TABLE mantis_bug_table ALTER COLUMN category_id SET NOT NULL;

DROP TABLE mantis_project_category_table CASCADE;

ALTER TABLE mantis_project_table ADD COLUMN category_id INTEGER  ;

UPDATE mantis_project_table SET category_id=1;

ALTER TABLE mantis_project_table ALTER COLUMN category_id SET DEFAULT 1;

ALTER TABLE mantis_project_table ALTER COLUMN category_id SET NOT NULL;

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

ALTER TABLE mantis_project_table ADD COLUMN inherit_global INTEGER  ;

UPDATE mantis_project_table SET inherit_global=0;

ALTER TABLE mantis_project_table ALTER COLUMN inherit_global SET DEFAULT 0;

ALTER TABLE mantis_project_table ALTER COLUMN inherit_global SET NOT NULL;

ALTER TABLE mantis_project_hierarchy_table ADD COLUMN inherit_parent INTEGER  ;

UPDATE mantis_project_hierarchy_table SET inherit_parent=0;

ALTER TABLE mantis_project_hierarchy_table ALTER COLUMN inherit_parent SET DEFAULT 0;

ALTER TABLE mantis_project_hierarchy_table ALTER COLUMN inherit_parent SET NOT NULL;

ALTER TABLE mantis_plugin_table ADD COLUMN protected BOOLEAN  ;

UPDATE mantis_plugin_table SET protected='0';

ALTER TABLE mantis_plugin_table ALTER COLUMN protected SET DEFAULT '0';

ALTER TABLE mantis_plugin_table ALTER COLUMN protected SET NOT NULL;

ALTER TABLE mantis_plugin_table ADD COLUMN priority INTEGER  ;

UPDATE mantis_plugin_table SET priority=3;

ALTER TABLE mantis_plugin_table ALTER COLUMN priority SET DEFAULT 3;

ALTER TABLE mantis_plugin_table ALTER COLUMN priority SET NOT NULL;

ALTER TABLE mantis_project_version_table ADD COLUMN obsolete BOOLEAN  ;

UPDATE mantis_project_version_table SET obsolete='0';

ALTER TABLE mantis_project_version_table ALTER COLUMN obsolete SET DEFAULT '0';

ALTER TABLE mantis_project_version_table ALTER COLUMN obsolete SET NOT NULL;

ALTER TABLE mantis_bug_table ADD COLUMN due_date TIMESTAMP  ;

UPDATE mantis_bug_table SET due_date='1970-01-01 00:00:01';

ALTER TABLE mantis_bug_table ALTER COLUMN due_date SET DEFAULT '1970-01-01 00:00:01';

ALTER TABLE mantis_bug_table ALTER COLUMN due_date SET NOT NULL;

ALTER TABLE mantis_custom_field_table ADD COLUMN filter_by BOOLEAN  ;

UPDATE mantis_custom_field_table SET filter_by='1';

ALTER TABLE mantis_custom_field_table ALTER COLUMN filter_by SET DEFAULT '1';

ALTER TABLE mantis_custom_field_table ALTER COLUMN filter_by SET NOT NULL;

CREATE TABLE mantis_bug_revision_table (
id                       SERIAL,
bug_id                   INTEGER NOT NULL,
bugnote_id               INTEGER DEFAULT 0 NOT NULL,
user_id                  INTEGER NOT NULL,
timestamp                TIMESTAMP DEFAULT '1970-01-01 00:00:01' NOT NULL,
type                     INTEGER 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 COLUMN date_submitted_int INTEGER  ;

UPDATE mantis_bug_table SET date_submitted_int=1;

ALTER TABLE mantis_bug_table ALTER COLUMN date_submitted_int SET DEFAULT 1;

ALTER TABLE mantis_bug_table ALTER COLUMN date_submitted_int SET NOT NULL;

ALTER TABLE mantis_bug_table ADD COLUMN due_date_int INTEGER  ;

UPDATE mantis_bug_table SET due_date_int=1;

ALTER TABLE mantis_bug_table ALTER COLUMN due_date_int SET DEFAULT 1;

ALTER TABLE mantis_bug_table ALTER COLUMN due_date_int SET NOT NULL;

ALTER TABLE mantis_bug_table ADD COLUMN last_updated_int INTEGER  ;

UPDATE mantis_bug_table SET last_updated_int=1;

ALTER TABLE mantis_bug_table ALTER COLUMN last_updated_int SET DEFAULT 1;

ALTER TABLE mantis_bug_table ALTER COLUMN last_updated_int SET NOT NULL;

ALTER TABLE mantis_bug_table RENAME COLUMN date_submitted_int TO date_submitted;

ALTER TABLE mantis_bug_table RENAME COLUMN due_date_int TO due_date;

ALTER TABLE mantis_bug_table RENAME COLUMN last_updated_int TO last_updated;

ALTER TABLE mantis_bugnote_table ADD COLUMN last_modified_int INTEGER  ;

UPDATE mantis_bugnote_table SET last_modified_int=1;

ALTER TABLE mantis_bugnote_table ALTER COLUMN last_modified_int SET DEFAULT 1;

ALTER TABLE mantis_bugnote_table ALTER COLUMN last_modified_int SET NOT NULL;

ALTER TABLE mantis_bugnote_table ADD COLUMN date_submitted_int INTEGER  ;

UPDATE mantis_bugnote_table SET date_submitted_int=1;

ALTER TABLE mantis_bugnote_table ALTER COLUMN date_submitted_int SET DEFAULT 1;

ALTER TABLE mantis_bugnote_table ALTER COLUMN date_submitted_int SET NOT NULL;

ALTER TABLE mantis_bugnote_table RENAME COLUMN last_modified_int TO last_modified;

CREATE INDEX idx_last_mod ON mantis_bugnote_table (last_modified);

ALTER TABLE mantis_bugnote_table RENAME COLUMN date_submitted_int TO date_submitted;

ALTER TABLE mantis_bug_file_table ADD COLUMN date_added_int INTEGER  ;

UPDATE mantis_bug_file_table SET date_added_int=1;

ALTER TABLE mantis_bug_file_table ALTER COLUMN date_added_int SET DEFAULT 1;

ALTER TABLE mantis_bug_file_table ALTER COLUMN date_added_int SET NOT NULL;

ALTER TABLE mantis_bug_file_table RENAME COLUMN date_added_int TO date_added;

ALTER TABLE mantis_project_file_table ADD COLUMN date_added_int INTEGER  ;

UPDATE mantis_project_file_table SET date_added_int=1;

ALTER TABLE mantis_project_file_table ALTER COLUMN date_added_int SET DEFAULT 1;

ALTER TABLE mantis_project_file_table ALTER COLUMN date_added_int SET NOT NULL;

ALTER TABLE mantis_project_file_table RENAME COLUMN date_added_int TO date_added;

ALTER TABLE mantis_bug_history_table ADD COLUMN date_modified_int INTEGER  ;

UPDATE mantis_bug_history_table SET date_modified_int=1;

ALTER TABLE mantis_bug_history_table ALTER COLUMN date_modified_int SET DEFAULT 1;

ALTER TABLE mantis_bug_history_table ALTER COLUMN date_modified_int SET NOT NULL;

ALTER TABLE mantis_bug_history_table RENAME COLUMN date_modified_int TO date_modified;

ALTER TABLE mantis_user_table ADD COLUMN last_visit_int INTEGER  ;

UPDATE mantis_user_table SET last_visit_int=1;

ALTER TABLE mantis_user_table ALTER COLUMN last_visit_int SET DEFAULT 1;

ALTER TABLE mantis_user_table ALTER COLUMN last_visit_int SET NOT NULL;

ALTER TABLE mantis_user_table ADD COLUMN date_created_int INTEGER  ;

UPDATE mantis_user_table SET date_created_int=1;

ALTER TABLE mantis_user_table ALTER COLUMN date_created_int SET DEFAULT 1;

ALTER TABLE mantis_user_table ALTER COLUMN date_created_int SET NOT NULL;

ALTER TABLE mantis_user_table RENAME COLUMN date_created_int TO date_created;

ALTER TABLE mantis_user_table RENAME COLUMN last_visit_int TO last_visit;

ALTER TABLE mantis_email_table ADD COLUMN submitted_int INTEGER  ;

UPDATE mantis_email_table SET submitted_int=1;

ALTER TABLE mantis_email_table ALTER COLUMN submitted_int SET DEFAULT 1;

ALTER TABLE mantis_email_table ALTER COLUMN submitted_int SET NOT NULL;

ALTER TABLE mantis_email_table RENAME COLUMN submitted_int TO submitted;

ALTER TABLE mantis_tag_table ADD COLUMN date_created_int INTEGER  ;

UPDATE mantis_tag_table SET date_created_int=1;

ALTER TABLE mantis_tag_table ALTER COLUMN date_created_int SET DEFAULT 1;

ALTER TABLE mantis_tag_table ALTER COLUMN date_created_int SET NOT NULL;

ALTER TABLE mantis_tag_table ADD COLUMN date_updated_int INTEGER  ;

UPDATE mantis_tag_table SET date_updated_int=1;

ALTER TABLE mantis_tag_table ALTER COLUMN date_updated_int SET DEFAULT 1;

ALTER TABLE mantis_tag_table ALTER COLUMN date_updated_int SET NOT NULL;

ALTER TABLE mantis_tag_table RENAME COLUMN date_created_int TO date_created;

ALTER TABLE mantis_tag_table RENAME COLUMN date_updated_int TO date_updated;

ALTER TABLE mantis_bug_tag_table ADD COLUMN date_attached_int INTEGER  ;

UPDATE mantis_bug_tag_table SET date_attached_int=1;

ALTER TABLE mantis_bug_tag_table ALTER COLUMN date_attached_int SET DEFAULT 1;

ALTER TABLE mantis_bug_tag_table ALTER COLUMN date_attached_int SET NOT NULL;

ALTER TABLE mantis_bug_tag_table RENAME COLUMN date_attached_int TO date_attached;

ALTER TABLE mantis_tokens_table ADD COLUMN timestamp_int INTEGER  ;

UPDATE mantis_tokens_table SET timestamp_int=1;

ALTER TABLE mantis_tokens_table ALTER COLUMN timestamp_int SET DEFAULT 1;

ALTER TABLE mantis_tokens_table ALTER COLUMN timestamp_int SET NOT NULL;

ALTER TABLE mantis_tokens_table ADD COLUMN expiry_int INTEGER  ;

UPDATE mantis_tokens_table SET expiry_int=1;

ALTER TABLE mantis_tokens_table ALTER COLUMN expiry_int SET DEFAULT 1;

ALTER TABLE mantis_tokens_table ALTER COLUMN expiry_int SET NOT NULL;

ALTER TABLE mantis_tokens_table RENAME COLUMN timestamp_int TO timestamp;

ALTER TABLE mantis_tokens_table RENAME COLUMN expiry_int TO expiry;

ALTER TABLE mantis_news_table ADD COLUMN last_modified_int INTEGER  ;

UPDATE mantis_news_table SET last_modified_int=1;

ALTER TABLE mantis_news_table ALTER COLUMN last_modified_int SET DEFAULT 1;

ALTER TABLE mantis_news_table ALTER COLUMN last_modified_int SET NOT NULL;

ALTER TABLE mantis_news_table ADD COLUMN date_posted_int INTEGER  ;

UPDATE mantis_news_table SET date_posted_int=1;

ALTER TABLE mantis_news_table ALTER COLUMN date_posted_int SET DEFAULT 1;

ALTER TABLE mantis_news_table ALTER COLUMN date_posted_int SET NOT NULL;

ALTER TABLE mantis_news_table RENAME COLUMN last_modified_int TO last_modified;

ALTER TABLE mantis_news_table RENAME COLUMN date_posted_int TO date_posted;

ALTER TABLE mantis_bug_revision_table ADD COLUMN timestamp_int INTEGER  ;

UPDATE mantis_bug_revision_table SET timestamp_int=1;

ALTER TABLE mantis_bug_revision_table ALTER COLUMN timestamp_int SET DEFAULT 1;

ALTER TABLE mantis_bug_revision_table ALTER COLUMN timestamp_int SET NOT NULL;

ALTER TABLE mantis_bug_revision_table RENAME COLUMN timestamp_int TO timestamp;

CREATE INDEX idx_bug_rev_id_time ON mantis_bug_revision_table (bug_id, timestamp);

ALTER TABLE mantis_user_pref_table ADD COLUMN timezone VARCHAR(32)  ;

UPDATE mantis_user_pref_table SET timezone='';

ALTER TABLE mantis_user_pref_table ALTER COLUMN timezone SET DEFAULT '';

ALTER TABLE mantis_user_pref_table ALTER COLUMN timezone SET NOT NULL;

ALTER TABLE mantis_project_version_table ADD COLUMN date_order_int INTEGER  ;

UPDATE mantis_project_version_table SET date_order_int=1;

ALTER TABLE mantis_project_version_table ALTER COLUMN date_order_int SET DEFAULT 1;

ALTER TABLE mantis_project_version_table ALTER COLUMN date_order_int SET NOT NULL;

ALTER TABLE mantis_project_version_table RENAME COLUMN date_order_int TO date_order;

ALTER TABLE mantis_sponsorship_table ADD COLUMN date_submitted_int INTEGER  ;

UPDATE mantis_sponsorship_table SET date_submitted_int=1;

ALTER TABLE mantis_sponsorship_table ALTER COLUMN date_submitted_int SET DEFAULT 1;

ALTER TABLE mantis_sponsorship_table ALTER COLUMN date_submitted_int SET NOT NULL;

ALTER TABLE mantis_sponsorship_table ADD COLUMN last_updated_int INTEGER  ;

UPDATE mantis_sponsorship_table SET last_updated_int=1;

ALTER TABLE mantis_sponsorship_table ALTER COLUMN last_updated_int SET DEFAULT 1;

ALTER TABLE mantis_sponsorship_table ALTER COLUMN last_updated_int SET NOT NULL;

ALTER TABLE mantis_sponsorship_table RENAME COLUMN last_updated_int TO last_updated;

ALTER TABLE mantis_sponsorship_table RENAME COLUMN date_submitted_int TO date_submitted;

ALTER TABLE mantis_project_file_table ADD COLUMN user_id INTEGER  ;

UPDATE mantis_project_file_table SET user_id=0;

ALTER TABLE mantis_project_file_table ALTER COLUMN user_id SET DEFAULT 0;

ALTER TABLE mantis_project_file_table ALTER COLUMN user_id SET NOT NULL;

ALTER TABLE mantis_bug_file_table ADD COLUMN user_id INTEGER  ;

UPDATE mantis_bug_file_table SET user_id=0;

ALTER TABLE mantis_bug_file_table ALTER COLUMN user_id SET DEFAULT 0;

ALTER TABLE mantis_bug_file_table ALTER COLUMN user_id SET NOT NULL;

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);

correct_multiselect_custom_fields_db_format;

ALTER TABLE mantis_custom_field_string_table ADD COLUMN text TEXT ;

UPDATE mantis_custom_field_string_table SET text=NULL;

ALTER TABLE mantis_custom_field_string_table ALTER COLUMN text SET DEFAULT NULL;

CREATE INDEX idx_bug_id ON mantis_bug_monitor_table (bug_id);

CREATE UNIQUE INDEX idx_project_hierarchy ON mantis_project_hierarchy_table (child_id, parent_id);

CREATE INDEX idx_bug_history_date_modified ON mantis_bug_history_table (date_modified);

stored_filter_migrate;

;

stored_filter_migrate;

;

CREATE TABLE mantis_api_token_table (
id                       SERIAL,
user_id                  INTEGER DEFAULT 0 NOT NULL,
name                     VARCHAR(128) NOT NULL,
hash                     VARCHAR(128) NOT NULL,
date_created             INTEGER DEFAULT 0 NOT NULL,
date_used                INTEGER DEFAULT 0 NOT NULL,
                 PRIMARY KEY (id)
);

CREATE UNIQUE INDEX idx_user_id_name ON mantis_api_token_table (user_id, name);

CREATE INDEX idx_email ON mantis_user_table (email);

INSERT INTO mantis_config_table ( value, type, access_reqd, config_id, project_id, user_id ) VALUES ('209', 1, 90, 'database_version', 0, 0 );
</pre><br /><p style="color:red">Your database has not been created yet. Please create the database, then install the tables and data using the information above before proceeding.</p></td></tr></table>
</div>
</div>
</div>
</div>
</div>


<div class="col-md-12 col-xs-12">
<div class="space-10"></div>
<div class="widget-box widget-color-blue2">
<div class="widget-header widget-header-small">
	<h4 class="widget-title lighter">
		Write Configuration File(s)
	</h4>
</div>
<div class="widget-body">
<div class="widget-main no-padding">
<div class="table-responsive">
<table class="table table-bordered table-condensed">
<tr>
    <td>
        Creating        Configuration File (config/config_inc.php)<br />
    </td>
<td class="warning">POSSIBLE PROBLEM<br />cannot write /var/www/tareas/config/config_inc.php</td></tr>
<tr>
	<td colspan="2">
		<table width="50%" cellpadding="10" cellspacing="1">
			<tr>
				<td>
					Please add the following lines to
					<em>'/var/www/tareas/config/config_inc.php'</em>
					before continuing:
				</td>
			</tr>
			<tr>
				<td>
					<pre>&lt;?php
$g_hostname               = 'server';
$g_db_type                = 'pgsql';
$g_database_name          = 'x';
$g_db_username            = 'y';
$g_db_password            = 'abcde12345';

$g_default_timezone       = 'America/Argentina/Buenos_Aires';

$g_crypto_master_salt     = 'YU2HKDFT5YqIj6lk1jDfAKQjpMKgM6//cIxN2TO6Ubk=';
</pre>
				</td>
			</tr>
		</table>
	</td>
</tr>

</table>
</div>
</div>
</div>
</div>
</div>

<div class="col-md-12 col-xs-12">
<div class="space-10"></div>
<div class="widget-box widget-color-blue2">
<div class="widget-header widget-header-small">
	<h4 class="widget-title lighter">
		Checking Installation
	</h4>
</div>
<div class="widget-body">
<div class="widget-main no-padding">
<div class="table-responsive">
<table class="table table-bordered table-condensed">

<tr>
	<td>
		Attempting to connect to database as user
	</td>
	<td class="warning">POSSIBLE PROBLEM<br />Database user does not have access to the database ( -24 )</td></tr>
<tr>
	<td>
		checking ability to SELECT records
	</td>
	<td class="success">GOOD</td></tr>
<tr>
	<td>
		checking ability to INSERT records
	</td>
	<td class="success">GOOD</td></tr>
<tr>
	<td>
		checking ability to UPDATE records
	</td>
	<td class="success">GOOD</td></tr>
<tr>
	<td>
		checking ability to DELETE records
	</td>
	<td class="success">GOOD</td></tr>
</table>
</div>
</div>
</div>
</div>
</div>

<div class="col-md-12 col-xs-12">
<div class="space-10"></div>
<div class="widget-box widget-color-blue2">
<div class="widget-header widget-header-small">
	<h4 class="widget-title lighter">
		Installation Complete
	</h4>
</div>
<div class="widget-body">
<div class="widget-main no-padding">
<div class="table-responsive">
<table class="table table-bordered table-condensed">
<tr>
	<td>
		<span class="bigger-130">
		MantisBT was installed successfully.
		Please log in as the administrator and <a href="../login_page.php">create</a> your first project.
		</span>
	</td>
	<td class="success">GOOD</td></tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="space-20"></div>
<div class="footer noprint">
<div class="footer-inner">
<div class="footer-content">
<div class="col-md-6 col-xs-12 no-padding">
<address>
<strong>Powered by <a href="https://www.mantisbt.org" title="bug tracking software">MantisBT </a></strong> <br>
<small>Copyright &copy; 2000 - 2017 MantisBT Team</small><br><small>Contacta con el <a href="mailto:webmaster@example.com" title="Contacto con webmaster vía correo electrónico.">administrador</a> por ayuda</small><br>
</address>
</div>
<div class="col-md-6 col-xs-12">
<div class="pull-right" id="powered-by-mantisbt-logo">
<a href="https://www.mantisbt.org" title="Mantis Bug Tracker: a free and open source web based bug tracking system."><img src="/images/mantis_logo.png" width="102" height="35" alt="Powered by Mantis Bug Tracker: a free and open source web based bug tracking system." /></a>
</div>
</div>
</div>
</div>
</div>
<a class="btn-scroll-up btn btn-sm btn-inverse display" id="btn-scroll-up" href="#">
<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
</div>
	<script type="text/javascript" src="/js/bootstrap-3.3.6.min.js"></script>
	<script type="text/javascript" src="/js/moment-with-locales-2.15.2.min.js"></script>
	<script type="text/javascript" src="/js/bootstrap-datetimepicker-4.17.47.min.js"></script>
	<script type="text/javascript" src="/js/typeahead.jquery-1.1.1.min.js"></script>
	<script type="text/javascript" src="/js/list-1.4.1.min.js"></script>
	<script type="text/javascript" src="/js/ace.min.js"></script>
</body>
</html>
ddave

ddave

2017-12-20 14:26

reporter   ~0058430

The error occurs when the user log in:

APPLICATION ERROR 0000401

DB Query error. Error from DB #-1: ERROR: date/time field value out of range: "1513795190"
HINT: Perhaps you need a different "datestyle" setting. pro dotaz DELETE FROM mantis_tokens_table WHERE $1 > expiry.

ddave

ddave

2017-12-20 14:31

reporter   ~0058431

The field "expiry" is a "timestamp without time zone", the max value from this data type in PostgreSQL is 294276, that value is less than 1513795190.

https://www.postgresql.org/docs/9.4/static/datatype-datetime.html

dregad

dregad

2017-12-21 04:04

developer   ~0058433

Before 2009, MantisBT stored date/time information in the RDBMS' native timestamp type, as managed by the underlying database abstraction library we use (ADOdb). In April 2009, these fields were changed to integer. Because of how our installer works in order to maintain compatibility when upgrading MantisBT, even today the columns are always initially created as TIMESTAMP, then altered to change type to INT. It's worth noting that the upgrade process includes non-SQL steps, e.g. to convert the timestamp to integer.

If you look at what happens to the expiry column in the log you uploaded (Administration - Installation - MantisBT(1).html), you'll see line 383:

CREATE TABLE mantis_tokens_table (
[...]
expiry                   TIMESTAMP,

Compare with installer source code. Later, you'll see (lines 798 to 898):

ALTER TABLE mantis_tokens_table ADD COLUMN expiry_int INTEGER  ;
UPDATE mantis_tokens_table SET expiry_int=1;
ALTER TABLE mantis_tokens_table ALTER COLUMN expiry_int SET DEFAULT 1;
ALTER TABLE mantis_tokens_table ALTER COLUMN expiry_int SET NOT NULL;
[...]
ALTER TABLE mantis_tokens_table RENAME COLUMN expiry_int TO expiry;

This matches upgrade steps 141 and 146.

What you don't get in the SQL log is

  • The expiry column data migration (PHP code), step 142; you may not care for this in the case of a new installation, but in an upgrade scenario not running this code this will lead to data loss or corruption.
  • Removal of old timestamp column, step 145. As a side note, I'm not sure off-hand why this is not included in the log, but I don't have time to investigate.

Bottom line is, as mentioned by @atrol, we do not recommend to manually run the SQL script. Please install MantisBT as documented in the admin guide. If you decide not to follow our instructions, then you're on your own in terms of support.