Community Support for OpenDocMan (Deprecated)

Full Version: Problem creating tables during INSTALL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Mac OS X 10.8.4
Apache/2.2.22
PHP/5.3/15
MySQL 5.7.1-m11
OpenDocMan 1.2.6.6

Thank you in advance for any assistance. I am new and I cannot figure this out. During the installation, I am stuck here:

Checking that templates_c folder is writeable... OK
installing...
Database Created
Database Selected

Could not create odm_data table. Error wasBig Grinuplicate index 'id_2' defined on the table 'docman.odm_data'. This is deprecated and will be disallowed in a future release.


Thanks,
Emmanuel
I may have resolved it. It appears to be a bug that was fixed in MySQL 5.6.



../opendocman-1.2.6.6/install/odm.php


// Data Table

$result = mysql_query("
DROP TABLE IF EXISTS {$dbprefix}data
") or die("<br>Could not create {$dbprefix}data table. Error was:" . mysql_error());

$result = mysql_query("
CREATE TABLE {$dbprefix}data (
id int(11) unsigned NOT NULL auto_increment,
category int(11) unsigned NOT NULL default '0',
owner int(11) unsigned default NULL,
realname varchar(255) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00',
description varchar(255) default NULL,
comment varchar(255) default '',
status smallint(6) default NULL,
department smallint(6) unsigned default NULL,
default_rights tinyint(4) default NULL,
publishable tinyint(4) default NULL,
reviewer int(11) unsigned default NULL,
reviewer_comments varchar(255) default NULL,
PRIMARY KEY (id)[b],
KEY data_idx (id,owner),
KEY id (id),
KEY id_2 (id),
KEY publishable (publishable),
KEY description (description)
[/b]

) ENGINE = MYISAM
") or die("<br>Could not create {$dbprefix}data table. Error was:" . mysql_error());

-----------------CHANGE TO ----------------------------

$result = mysql_query("
DROP TABLE IF EXISTS {$dbprefix}data
") or die("<br>Could not create {$dbprefix}data table. Error was:" . mysql_error());

$result = mysql_query("
CREATE TABLE {$dbprefix}data (
id int(11) unsigned NOT NULL auto_increment,
category int(11) unsigned NOT NULL default '0',
owner int(11) unsigned default NULL,
realname varchar(255) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00',
description varchar(255) default NULL,
comment varchar(255) default '',
status smallint(6) default NULL,
department smallint(6) unsigned default NULL,
default_rights tinyint(4) default NULL,
publishable tinyint(4) default NULL,
reviewer int(11) unsigned default NULL,
reviewer_comments varchar(255) default NULL,
PRIMARY KEY (id)
) ENGINE = MYISAM
") or die("<br>Could not create {$dbprefix}data table. Error was:" . mysql_error());

-------------REASONS FOR CHANGING IT-----------------------

<!-- m --><a class="postlink" href="http://www.mysqlperformanceblog.com/2013/05/31/the-small-improvements-of-mysql-5-6-duplicate-index-detection/">http://www.mysqlperformanceblog.com/201 ... detection/</a><!-- m -->

<!-- m --><a class="postlink" href="http://bugs.mysql.com/bug.php?id=37520">http://bugs.mysql.com/bug.php?id=37520</a><!-- m -->