From 1b2a38043b16bb6a8de84908149a7acb71eb3088 Mon Sep 17 00:00:00 2001 From: paca70 Date: Sun, 31 Oct 2004 14:36:35 +0000 Subject: [PATCH] Theres no enums in postgresql 7.x. Fix for this. --- blocks/db/postgres7.php | 12 ++++++------ blocks/db/postgres7.sql | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/blocks/db/postgres7.php b/blocks/db/postgres7.php index ef29933a8f70a..1c0cb7f5b39ad 100644 --- a/blocks/db/postgres7.php +++ b/blocks/db/postgres7.php @@ -44,8 +44,8 @@ function blocks_upgrade($oldversion=0) { 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 @@ function blocks_upgrade($oldversion=0) { } 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 @@ function blocks_upgrade($oldversion=0) { 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 c60694d3e4366..a4355b25f82c7 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 ''