Skip to content

Commit

Permalink
Fixed issue #8339: Some schema fixes for PostgreSQL based installations
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Nov 20, 2013
1 parent 3572012 commit 8b6a591
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions application/config/version.php
Expand Up @@ -12,8 +12,8 @@
*
*/

$config['versionnumber'] = "2.05RC6";
$config['dbversionnumber'] = 171;
$config['versionnumber'] = "2.05+";
$config['dbversionnumber'] = 172;
$config['buildnumber'] = '';
$config['updatable'] = true;

Expand Down
5 changes: 5 additions & 0 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -1157,6 +1157,11 @@ function db_upgrade_all($iOldDBVersion) {
}
$db->createCommand()->update('{{settings_global}}',array('stg_value'=>171),"stg_name='DBVersion'");
}
if ($iOldDBVersion < 172)
{
alterColumn('{{permissions}}', 'entity_id', "INTEGER", false);
$db->createCommand()->update('{{settings_global}}',array('stg_value'=>172),"stg_name='DBVersion'");
}
$oTransaction->commit();
}
catch(Exception $e)
Expand Down
4 changes: 2 additions & 2 deletions installer/sql/create-mssql.sql
Expand Up @@ -211,7 +211,7 @@ PRIMARY KEY ([participant_id])
CREATE TABLE [prefix_permissions] (
[id] int NOT NULL IDENTITY (1,1) PRIMARY KEY,
[entity] varchar(50) NOT NULL,
[entity_id] varchar(100) NOT NULL,
[entity_id] int NOT NULL,
[uid] int NOT NULL,
[permission] varchar(100) NOT NULL,
[create_p] int NOT NULL default '0',
Expand Down Expand Up @@ -576,4 +576,4 @@ create index [parent_qid_idx] on [prefix_questions] ([parent_qid]);
--
-- Version Info
--
INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '171');
INSERT INTO [prefix_settings_global] VALUES ('DBVersion', '172');
4 changes: 2 additions & 2 deletions installer/sql/create-mysql.sql
Expand Up @@ -211,7 +211,7 @@ CREATE TABLE `prefix_participants` (
CREATE TABLE `prefix_permissions` (
`id` int(11) NOT NULL auto_increment,
`entity` varchar(50) NOT NULL,
`entity_id` varchar(100) NOT NULL,
`entity_id` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`permission` varchar(100) NOT NULL,
`create_p` int(11) NOT NULL default '0',
Expand Down Expand Up @@ -581,4 +581,4 @@ create index `parent_qid_idx` on `prefix_questions` (`parent_qid`);
--
-- Version Info
--
INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '171');
INSERT INTO `prefix_settings_global` VALUES ('DBVersion', '172');
4 changes: 2 additions & 2 deletions installer/sql/create-pgsql.sql
Expand Up @@ -216,7 +216,7 @@ CREATE TABLE prefix_participants (
CREATE TABLE prefix_permissions (
id serial NOT NULL,
entity character varying(50) NOT NULL,
entity_id character varying(100) NOT NULL,
entity_id integer NOT NULL,
uid integer NOT NULL,
permission character varying(100) NOT NULL,
create_p integer DEFAULT 0 NOT NULL,
Expand Down Expand Up @@ -585,4 +585,4 @@ create unique index permissions_idx2 ON lime_permissions (entity_id, entity, uid
--
-- Version Info
--
INSERT INTO prefix_settings_global VALUES ('DBVersion', '171');
INSERT INTO prefix_settings_global VALUES ('DBVersion', '172');

0 comments on commit 8b6a591

Please sign in to comment.