--- /dev/null
+<?php
+class HordePrefsBaseTables extends Horde_Db_Migration_Base
+{
+ public function up()
+ {
+ if (!in_array('horde_prefs', $this->tables())) {
+ $t = $this->createTable('horde_prefs', array('primaryKey' => array('pref_uid', 'pref_scope', 'pref_name')));
+ $t->column('pref_uid', 'string', array('limit' => 255, 'null' => false));
+ $t->column('pref_scope', 'string', array('limit' => 16, 'null' => false, 'default' => ''));
+ $t->column('pref_name', 'string', array('limit' => 32, 'null' => false));
+ $t->column('pref_value', 'text');
+ $t->end();
+ $this->addIndex('horde_prefs', array('pref_uid'));
+ $this->addIndex('horde_prefs', array('pref_scope'));
+ }
+ }
+
+ public function down()
+ {
+ $this->dropTable('horde_prefs');
+ }
+}
+++ /dev/null
-CREATE TABLE horde_prefs (
- pref_uid VARCHAR(255) NOT NULL,
- pref_scope VARCHAR(16) DEFAULT '' NOT NULL,
- pref_name VARCHAR(32) NOT NULL,
- pref_value VARCHAR(MAX),
---
- PRIMARY KEY (pref_uid, pref_scope, pref_name)
-);
-
-CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid);
-CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope);
+++ /dev/null
-CREATE TABLE horde_prefs (
- pref_uid VARCHAR(255) NOT NULL,
- pref_scope VARCHAR(16) DEFAULT '' NOT NULL,
- pref_name VARCHAR(32) NOT NULL,
- pref_value BYTEA,
---
- PRIMARY KEY (pref_uid, pref_scope, pref_name)
-);
-
-CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid);
-CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope);
+++ /dev/null
-CREATE TABLE horde_prefs (
- pref_uid VARCHAR(255) NOT NULL,
- pref_scope VARCHAR(16) DEFAULT '' NOT NULL,
- pref_name VARCHAR(32) NOT NULL,
- pref_value TEXT,
---
- PRIMARY KEY (pref_uid, pref_scope, pref_name)
-);
-
-CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid);
-CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope);
+++ /dev/null
--- Use this script to convert CHAR columns in horde_prefs to VARCHAR2 and trim
--- the space padding. This is only necessary if horde_prefs was created using
--- scripts/sql/create.oci8.sql
-ALTER TABLE horde_prefs MODIFY pref_uid VARCHAR2(255);
-ALTER TABLE horde_prefs MODIFY pref_scope VARCHAR2(16);
-ALTER TABLE horde_prefs MODIFY pref_name VARCHAR2(32);
-UPDATE horde_prefs SET pref_uid = RTRIM(pref_uid);
-UPDATE horde_prefs SET pref_scope = RTRIM(pref_scope);
-UPDATE horde_prefs SET pref_name = RTRIM(pref_name);
+++ /dev/null
--- This script adds additional indexes to the horde_prefs table that should
--- improve loading of preferences from the preference table.
-
-CREATE INDEX pref_uid_idx ON horde_prefs (pref_uid);
-CREATE INDEX pref_scope_idx ON horde_prefs (pref_scope);
-