Permalink
Browse files

Theres no enums in postgresql 7.x. Fix for this.

  • Loading branch information...
1 parent 4275bed commit 1b2a38043b16bb6a8de84908149a7acb71eb3088 paca70 committed Oct 31, 2004
Showing with 8 additions and 8 deletions.
  1. +6 −6 blocks/db/postgres7.php
  2. +2 −2 blocks/db/postgres7.sql
View
@@ -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) {
View
@@ -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 ''

0 comments on commit 1b2a380

Please sign in to comment.