Skip to content

Commit

Permalink
Theres no enums in postgresql 7.x. Fix for this.
Browse files Browse the repository at this point in the history
  • Loading branch information
paca70 committed Oct 31, 2004
1 parent 4275bed commit 1b2a380
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions blocks/db/postgres7.php
Expand Up @@ -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'
)
Expand All @@ -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 ''
Expand All @@ -79,7 +79,7 @@ function blocks_upgrade($oldversion=0) {
if(!$result) {
return false;
}

$records = get_records('course');
if(!empty($records)) {
foreach($records as $thiscourse) {
Expand Down
4 changes: 2 additions & 2 deletions blocks/db/postgres7.sql
Expand Up @@ -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 ''
Expand Down

0 comments on commit 1b2a380

Please sign in to comment.