From: paca70 Date: Sun, 31 Oct 2004 14:36:35 +0000 (+0000) Subject: Theres no enums in postgresql 7.x. Fix for this. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1b2a38043b16bb6a8de84908149a7acb71eb3088;p=moodle.git Theres no enums in postgresql 7.x. Fix for this. --- diff --git a/blocks/db/postgres7.php b/blocks/db/postgres7.php index ef29933a8f..1c0cb7f5b3 100644 --- a/blocks/db/postgres7.php +++ b/blocks/db/postgres7.php @@ -44,8 +44,8 @@ global $CFG; id SERIAL8 PRIMARY KEY, name varchar(40) NOT NULL default '', version INT8 NOT NULL default '0', - cron INT8 unsigned NOT NULL default '0', - lastcron INT8 unsigned NOT NULL default '0', + cron INT8 NOT NULL default '0', + lastcron INT8 NOT NULL default '0', visible int NOT NULL default '1', multiple int NOT NULL default '0' ) @@ -64,13 +64,13 @@ global $CFG; } execute_sql("DROP TABLE {$CFG->prefix}blocks"); - + $result = execute_sql("CREATE TABLE {$CFG->prefix}block_instance ( id SERIAL8 PRIMARY KEY, blockid INT8 not null default '0', pageid INT8 not null default '0', - pagetype enum('course') not null, - position enum('l', 'r') not null, + pagetype varchar(12) not null check (pagetype in ('course')), + position char not null check (position in ('l', 'r')) , weight int not null default '0', visible int not null default '0', configdata text not null default '' @@ -79,7 +79,7 @@ global $CFG; if(!$result) { return false; } - + $records = get_records('course'); if(!empty($records)) { foreach($records as $thiscourse) { diff --git a/blocks/db/postgres7.sql b/blocks/db/postgres7.sql index c60694d3e4..a4355b25f8 100644 --- a/blocks/db/postgres7.sql +++ b/blocks/db/postgres7.sql @@ -17,8 +17,8 @@ CREATE TABLE prefix_block_instance ( id SERIAL8 PRIMARY KEY, blockid INT8 not null default '0', pageid INT8 not null default '0', - pagetype enum('course') not null, - position enum('l', 'r') not null, + pagetype varchar(12) not null check (pagetype in ('course')), + position char not null check (position in ('l', 'r')), weight int not null default '0', visible int not null default '0', configdata text not null default ''