Skip to content

Commit

Permalink
0000331: mysql column mis-match error during install
Browse files Browse the repository at this point in the history
  • Loading branch information
logart committed Jan 12, 2011
1 parent 8ef543d commit 0dbfd12
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ CREATE TABLE odm_category (
# Dumping data for table 'odm_category'
#

INSERT INTO odm_category VALUES (1,'SOP');
INSERT INTO odm_category VALUES (2,'Training Manual');
INSERT INTO odm_category VALUES (3,'Letter');
INSERT INTO odm_category VALUES (4,'Presentation');
INSERT INTO odm_category VALUES (NULL,'SOP');
INSERT INTO odm_category VALUES (NULL,'Training Manual');
INSERT INTO odm_category VALUES (NULL,'Letter');
INSERT INTO odm_category VALUES (NULL,'Presentation');

#
# Table structure for table 'odm_data'
Expand Down Expand Up @@ -81,7 +81,7 @@ CREATE TABLE odm_department (
# Dumping data for table 'odm_department'
#

INSERT INTO odm_department VALUES (1,'Information Systems');
INSERT INTO odm_department VALUES (NULL,'Information Systems');

#
# Table structure for table 'odm_dept_perms'
Expand Down Expand Up @@ -176,7 +176,7 @@ CREATE TABLE odm_user (
# Dumping data for table 'odm_user'
#

INSERT INTO odm_user VALUES (1,'admin','',1,'5555551212','[email protected]','User','Admin','');
INSERT INTO odm_user VALUES (NULL,'admin','',1,'5555551212','[email protected]','User','Admin','');

#
# Table structure for table 'odm_user_perms'
Expand Down Expand Up @@ -224,5 +224,5 @@ CREATE TABLE IF NOT EXISTS odm_odmsys
sys_value varchar(255)
) TYPE=MyISAM;

INSERT INTO odm_odmsys VALUES ('','version','1.2.6');
INSERT INTO odm_odmsys VALUES (NULL,'version','1.2.6');

14 changes: 7 additions & 7 deletions install/odm.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@
") or die("<br>Could not create {$GLOBALS['CONFIG']['db_prefix']}category table. Error was:" . mysql_error());

$result = mysql_query("
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}category VALUES (1,'SOP')
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}category VALUES (NULL,'SOP')
") or die("<br>Could not create {$GLOBALS['CONFIG']['db_prefix']}category. Error was:" . mysql_error());

$result = mysql_query("
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}category VALUES (2,'Training Manual')
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}category VALUES (NULL,'Training Manual')
") or die("<br>Could not create {$GLOBALS['CONFIG']['db_prefix']}category. Error was:" . mysql_error());

$result = mysql_query("
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}category VALUES (3,'Letter')
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}category VALUES (NULL,'Letter')
") or die("<br>Could not create {$GLOBALS['CONFIG']['db_prefix']}category. Error was:" . mysql_error());

$result = mysql_query("
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}category VALUES (4,'Presentation')
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}category VALUES (NULL,'Presentation')
") or die("<br>Could not create {$GLOBALS['CONFIG']['db_prefix']}category. Error was:" . mysql_error());

// Data table
Expand Down Expand Up @@ -108,7 +108,7 @@
") or die("<br>Could not create {$GLOBALS['CONFIG']['db_prefix']}department table. Error was:" . mysql_error());

$result = mysql_query("
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}department VALUES (1,'Information Systems')
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}department VALUES (NULL,'Information Systems')
") or die("<br>Could not {$GLOBALS['CONFIG']['db_prefix']}add department. Error was:" . mysql_error());

// Department Permissions table
Expand Down Expand Up @@ -220,7 +220,7 @@

// Create admin user
$result = mysql_query("
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}user VALUES (1,'admin','','1','5555551212','[email protected]','User','Admin','')
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}user VALUES (NULL,'admin','','1','5555551212','[email protected]','User','Admin','')
") or die("<br>Could not add user. Error was:" . mysql_error());

// User permissions table
Expand Down Expand Up @@ -260,5 +260,5 @@

// Create version number in db
$result = mysql_query("
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}odmsys VALUES ('version','1.2.6')
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}odmsys VALUES (NULL, 'version','1.2.6')
") or die("<br>Could not insert new version into {$GLOBALS['CONFIG']['db_prefix']}odmsys. Error was:" . mysql_error());
2 changes: 1 addition & 1 deletion install/upgrade_1252.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@

// Create version number in db
$result = mysql_query("
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}odmsys VALUES ('','version','1.2.6')
INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}odmsys VALUES (NULL,'version','1.2.6')
") or die("<br>Could insert new version into db user");

0 comments on commit 0dbfd12

Please sign in to comment.