From 68c2ea0a051fd9c203468b299793af2b19302c25 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 4 Nov 2010 14:54:11 -0400 Subject: [PATCH] migrations for whups Still needs autoincrement for non-share tables once whups, itself is migrated to Horde_Db. --- whups/migration/1_whups_base_tables.php | 305 +++++ whups/migration/2_whups_autoincrement_shares.php | 32 + whups/scripts/sql/whups.mssql.sql | 224 ---- whups/scripts/sql/whups.oci8.sql | 224 ---- whups/scripts/sql/whups.sql | 224 ---- whups/scripts/sql/whups.xml | 1368 -------------------- whups/scripts/upgrades/2006-07-12_add_due_date.sql | 3 - .../upgrades/2006-08-04_drop_subjectlist.sql | 4 - whups/scripts/upgrades/2008-02-27_add_defaults.sql | 3 - .../upgrades/2008-04-29_add_sql_share_tables.sql | 37 - .../2008-06-11_add_attribute_types.oci8.sql | 7 - .../2008-06-11_add_attribute_types.pgsql.sql | 14 - .../upgrades/2008-06-11_add_attribute_types.sql | 4 - .../upgrades/2008-06-13_add_queue_emails.sql | 1 - .../upgrades/2008-06-17_fix_varchar_lengths.sql | 2 - whups/scripts/upgrades/2008-06-24_add_replies.sql | 10 - .../upgrades/2008-07-10_add_query_slugs.sql | 1 - .../scripts/upgrades/2008-09-23_fix_group_uid.sql | 2 - .../2009-09-07_add_version_active.pgsql.sql | 4 - .../upgrades/2009-09-07_add_version_active.sql | 2 - 20 files changed, 337 insertions(+), 2134 deletions(-) create mode 100644 whups/migration/1_whups_base_tables.php create mode 100644 whups/migration/2_whups_autoincrement_shares.php delete mode 100644 whups/scripts/sql/whups.mssql.sql delete mode 100644 whups/scripts/sql/whups.oci8.sql delete mode 100644 whups/scripts/sql/whups.sql delete mode 100644 whups/scripts/sql/whups.xml delete mode 100644 whups/scripts/upgrades/2006-07-12_add_due_date.sql delete mode 100644 whups/scripts/upgrades/2006-08-04_drop_subjectlist.sql delete mode 100644 whups/scripts/upgrades/2008-02-27_add_defaults.sql delete mode 100644 whups/scripts/upgrades/2008-04-29_add_sql_share_tables.sql delete mode 100644 whups/scripts/upgrades/2008-06-11_add_attribute_types.oci8.sql delete mode 100644 whups/scripts/upgrades/2008-06-11_add_attribute_types.pgsql.sql delete mode 100644 whups/scripts/upgrades/2008-06-11_add_attribute_types.sql delete mode 100644 whups/scripts/upgrades/2008-06-13_add_queue_emails.sql delete mode 100644 whups/scripts/upgrades/2008-06-17_fix_varchar_lengths.sql delete mode 100644 whups/scripts/upgrades/2008-06-24_add_replies.sql delete mode 100644 whups/scripts/upgrades/2008-07-10_add_query_slugs.sql delete mode 100644 whups/scripts/upgrades/2008-09-23_fix_group_uid.sql delete mode 100644 whups/scripts/upgrades/2009-09-07_add_version_active.pgsql.sql delete mode 100644 whups/scripts/upgrades/2009-09-07_add_version_active.sql diff --git a/whups/migration/1_whups_base_tables.php b/whups/migration/1_whups_base_tables.php new file mode 100644 index 000000000..9114b5d45 --- /dev/null +++ b/whups/migration/1_whups_base_tables.php @@ -0,0 +1,305 @@ + + * @category Horde + * @license http://www.fsf.org/copyleft/gpl.html GPL + * @package Whups + */ +class WhupsBaseTables extends Horde_Db_Migration_Base +{ + /** + * Upgrade. + */ + public function up() + { + $tableList = $this->tables(); + + if (!in_array('whups_tickets', $tableList)) { + $t = $this->createTable('whups_tickets', array('primaryKey' => false)); + $t->column('ticket_id', 'integer', array('null' => false)); + $t->column('ticket_summary', 'string', array('limit' => 255)); + $t->column('user_id_requester', 'string', array('limit' => 255, 'null' => false)); + $t->column('queue_id', 'integer', array('null' => false)); + $t->column('version_id', 'integer'); + $t->column('type_id', 'integer', array('null' => false)); + $t->column('state_id', 'integer', array('null' => false)); + $t->column('priority_id', 'integer', array('null' => false)); + $t->column('ticket_timestamp', 'integer', array('null' => false)); + $t->column('ticket_due', 'integer'); + $t->column('date_updated', 'integer'); + $t->column('date_assigned', 'integer'); + $t->column('date_resolved', 'integer'); + $t->primaryKey(array('ticket_id')); + $t->end(); + + $this->addIndex('whups_tickets', array('queue_id')); + $this->addIndex('whups_tickets', array('state_id')); + $this->addIndex('whups_tickets', array('user_id_requester')); + $this->addIndex('whups_tickets', array('version_id')); + $this->addIndex('whups_tickets', array('priority_id')); + } + + if (!in_array('whups_ticket_owners', $tableList)) { + $t = $this->createTable('whups_ticket_owners', array('primaryKey' => false)); + $t->column('ticket_id', 'integer', array('null' => false)); + $t->column('ticket_owner', 'string', array('null' => false, 'limit' => 255)); + $t->primaryKey(array('ticket_id', 'ticket_owner')); + $t->end(); + + $this->addIndex('whups_ticket_owners', 'ticket_id'); + $this->addIndex('whups_ticket_owners', 'ticket_owner'); + } + + if (!in_array('whups_guests', $tableList)) { + $t = $this->createTable('whups_guests', array('primaryKey' => false)); + $t->column('guest_id', 'string', array('limit' => 255, 'null' => false)); + $t->column('guest_email', 'string', array('limit' => 255, 'null' => false)); + $t->primaryKey(array('guest_id')); + $t->end(); + } + + if (!in_array('whups_queues', $tableList)) { + $t = $this->createTable('whups_queues', array('primaryKey' => false)); + $t->column('queue_id', 'integer', array('null' => false)); + $t->column('queue_name', 'string', array('limit' => 64, 'null' => false)); + $t->column('queue_description', 'string', array('limit' => 255)); + $t->column('queue_versioned', 'smallint', array('default' => 0, 'null' => false)); + $t->column('queue_slug', 'text', array('limit' => 64)); + $t->column('queue_email', 'text', array('limit' => 64)); + $t->primaryKey(array('queue_id')); + $t->end(); + } + + if (!in_array('whups_queues_users', $tableList)) { + $t = $this->createTable('whups_queues_users', array('primaryKey' => false)); + $t->column('queue_id', 'integer', array('null' => false)); + $t->column('user_uid', 'string', array('limit' => 250, 'null' => false)); + $t->primaryKey(array('queue_id', 'user_uid')); + $t->end(); + } + + if (!in_array('whups_types', $tableList)) { + $t = $this->createTable('whups_types', array('primaryKey' => false)); + $t->column('type_id', 'integer', array('null' => false)); + $t->column('type_name', 'string', array('limit' => 64, 'null' => false)); + $t->column('type_description', 'string', array('limit' => 255)); + $t->primaryKey(array('type_id')); + $t->end(); + } + + if (!in_array('whups_types_queues', $tableList)) { + $t = $this->createTable('whups_types_queues', array('primaryKey' => false)); + $t->column('type_id', 'integer', array('null' => false)); + $t->column('queue_id', 'integer', array('null' => false)); + $t->column('type_default', 'smallint', array('null' => false, 'default' => 0)); + $t->end(); + + $this->addIndex('whups_types_queues', array('queue_id', 'type_id')); + } + + if (!in_array('whups_states', $tableList)) { + $t = $this->createTable('whups_states', array('primaryKey' => false)); + $t->column('state_id', 'integer', array('null' => false)); + $t->column('type_id', 'integer', array('null' => false)); + $t->column('state_name', 'string', array('limit' => 64, 'null' => false)); + $t->column('state_description', 'string', array('limit' => 255)); + $t->column('state_category', 'string', array('limit' => 16)); + $t->column('state_default', 'smallint', array('default' => 0, 'null' => false)); + $t->primaryKey(array('state_id')); + $t->end(); + + $this->addIndex('whups_states', array('type_id')); + $this->addIndex('whups_states', array('state_category')); + } + + if (!in_array('whups_replies', $tableList)) { + $t = $this->createTable('whups_replies', array('primaryKey' => false)); + $t->column('type_id', 'integer', array('null' => false)); + $t->column('reply_id', 'integer', array('null' => false)); + $t->column('reply_name', 'string', array('limit' => 255, 'null' => false)); + $t->column('reply_text', 'text', array('null' => false)); + $t->primaryKey(array('reply_id')); + $t->end(); + + $this->addIndex('whups_replies', array('type_id')); + $this->addIndex('whups_replies', array('reply_name')); + } + + if (!in_array('whups_attributes_desc', $tableList)) { + $t = $this->createTable('whups_attributes_desc', array('primaryKey' => false)); + $t->column('attribute_id', 'integer', array('null' => false)); + $t->column('type_id', 'integer', array('null' => false)); + $t->column('attribute_name', 'string', array('null' => false, 'limit' => 64)); + $t->column('attribute_description', 'string', array('null' => false, 'limit' => 255)); + $t->column('attribute_type', 'string', array('default' => 'text', 'null' => false, 'limit' => 255)); + $t->column('attribute_params', 'text'); + $t->column('attribute_required', 'smallint'); + $t->primaryKey(array('attribute_id')); + $t->end(); + } + + if (!in_array('whups_attributes', $tableList)) { + $t = $this->createTable('whups_attributes', array('primaryKey' => false)); + $t->column('ticket_id', 'integer', array('null' => false)); + $t->column('attribute_id', 'integer', array('null' => false)); + $t->column('attribute_value', 'string', array('limit' => 255)); + $t->end(); + } + + if (!in_array('whups_comments', $tableList)) { + $t = $this->createTable('whups_comments', array('primaryKey' => false)); + $t->column('comment_id', 'integer', array('null' => false)); + $t->column('ticket_id', 'integer', array('null' => false)); + $t->column('user_id_creator', 'string', array('limit' => 255, 'null' => false)); + $t->column('comment_text', 'text'); + $t->column('comment_timestamp', 'integer'); + $t->primaryKey(array('comment_id')); + $t->end(); + + $this->addIndex('whups_comments', array('ticket_id')); + } + + if (!in_array('whups_logs', $tableList)) { + $t = $this->createTable('whups_logs', array('primaryKey' => false)); + $t->column('log_id', 'integer', array('null' => false)); + $t->column('transaction_id', 'integer', array('null' => false)); + $t->column('ticket_id', 'integer', array('null' => false)); + $t->column('log_timestamp', 'integer', array('null' => false)); + $t->column('log_type', 'string', array('limit' => 255, 'null' => false)); + $t->column('log_value', 'string', array('null' => false)); + $t->column('log_value_num', 'integer'); + $t->column('user_id', 'string', array('limit' => 255, 'null' => false)); + $t->primaryKey(array('log_id')); + $t->end(); + + $this->addIndex('whups_logs', array('transaction_id')); + $this->addIndex('whups_logs', array('ticket_id')); + $this->addIndex('whups_logs', array('log_timestamp')); + } + + if (!in_array('whups_priorities', $tableList)) { + $t = $this->createTable('whups_priorities', array('primaryKey' => false)); + $t->column('priority_id', 'integer', array('null' => false)); + $t->column('type_id', 'integer', array('null' => false)); + $t->column('priority_name', 'string', array('limit' => 64)); + $t->column('priority_description', 'string', array('limit' => 255)); + $t->column('priority_default', 'smallint', array('defalut' => 0, 'null' => false)); + $t->primaryKey(array('priority_id')); + $t->end(); + + $this->addIndex('whups_priorities', array('type_id')); + } + + if (!in_array('whups_versions', $tableList)) { + $t = $this->createTable('whups_versions', array('primaryKey' => false)); + $t->column('version_id', 'integer', array('null' => false)); + $t->column('queue_id', 'integer', array('null' => false)); + $t->column('version_name', 'string', array('limit' => 64)); + $t->column('version_description', 'string', array('limit' => 255)); + $t->column('version_active', 'integer', array('default' => 1)); + $t->primaryKey(array('version_id')); + $t->end(); + + $this->addIndex('whups_versions', array('version_active')); + } + + if (!in_array('whups_ticket_listeners', $tableList)) { + $t = $this->createTable('whups_ticket_listeners', array('primaryKey' => false)); + $t->column('ticket_id', 'integer', array('null' => false)); + $t->column('user_uid', 'string', array('limit' => 255, 'null' => false)); + $t->end(); + + $this->addIndex('whups_ticket_listeners', array('ticket_id')); + } + + if (!in_array('whups_queries', $tableList)) { + $t = $this->createTable('whups_queries', array('primaryKey' => false)); + $t->column('query_id', 'integer', array('null' => false)); + $t->column('query_parameters', 'text'); + $t->column('query_object', 'text'); + $t->primaryKey(array('query_id')); + $t->end(); + } + + if (!in_array('whups_shares', $tableList)) { + $t = $this->createTable('whups_shares', array('primaryKey' => false)); + $t->column('share_id', 'integer', array('null' => false)); + $t->column('share_name', 'string', array('limit' => 255, 'null' => false)); + $t->column('share_owner', 'string', array('limit' => 255, 'null' => false)); + $t->column('share_flags', 'smallint', array('default' => 0, 'null' => false)); + $t->column('perm_creator', 'smallint', array('default' => 0, 'null' => false)); + $t->column('perm_default', 'smallint', array('default' => 0, 'null' => false)); + $t->column('perm_guest', 'smallint', array('default' => 0, 'null' => false)); + $t->column('attribute_name', 'string', array('limit' => 255, 'null' => false)); + $t->column('attribute_slug', 'string', array('limit' => 255)); + $t->primaryKey(array('share_id')); + $t->end(); + + $this->addIndex('whups_shares', array('share_name')); + $this->addIndex('whups_shares', array('share_owner')); + $this->addIndex('whups_shares', array('perm_creator')); + $this->addIndex('whups_shares', array('perm_default')); + $this->addIndex('whups_shares', array('perm_guest')); + } + + if (!in_array('whups_shares_groups', $tableList)) { + $t = $this->createTable('whups_shares_groups'); + $t->column('share_id', 'integer', array('null' => false)); + $t->column('group_uid', 'string', array('limit' => 255, 'null' => false)); + $t->column('perm', 'smallint', array('null' => false)); + $t->end(); + + $this->addIndex('whups_shares_groups', array('share_id')); + $this->addIndex('whups_shares_groups', array('group_uid')); + $this->addIndex('whups_shares_groups', array('perm')); + } + + if (!in_array('whups_shares_users', $tableList)) { + $t = $this->createTable('whups_shares_users'); + + $t->column('share_id', 'integer', array('null' => false)); + $t->column('user_uid', 'string', array('limit' => 255)); + $t->column('perm', 'smallint', array('null' => false)); + $t->end(); + + $this->addIndex('whups_shares_users', array('share_id')); + $this->addIndex('whups_shares_users', array('user_uid')); + $this->addIndex('whups_shares_users', array('perm')); + } + } + + /** + * Downgrade to 0 + */ + public function down() + { + $this->dropTable('whups_tickets'); + $this->dropTable('whups_ticket_owners'); + $this->dropTable('whups_guests'); + $this->dropTable('whups_queues'); + $this->dropTable('whups_queues_users'); + $this->dropTable('whups_types'); + $this->dropTable('whups_types_queues'); + $this->dropTable('whups_states'); + $this->dropTable('whups_replies'); + $this->dropTable('whups_attributes_desc'); + $this->dropTable('whups_attributes'); + $this->dropTable('whups_comments'); + $this->dropTable('whups_logs'); + $this->dropTable('whups_priorities'); + $this->dropTable('whups_versions'); + $this->dropTable('whups_ticket_listeners'); + $this->dropTable('whups_queries'); + $this->dropTable('whups_shares'); + $this->dropTable('whups_shares_groups'); + $this->dropTable('whups_shares_users'); + } + +} \ No newline at end of file diff --git a/whups/migration/2_whups_autoincrement_shares.php b/whups/migration/2_whups_autoincrement_shares.php new file mode 100644 index 000000000..43d4f9570 --- /dev/null +++ b/whups/migration/2_whups_autoincrement_shares.php @@ -0,0 +1,32 @@ + + * @category Horde + * @license http://www.fsf.org/copyleft/gpl.html GPL + * @package Whups + */ +class WhupsAutoIncrementShares extends Horde_Db_Migration_Base +{ + /** + * Upgrade. + */ + public function up() + { + $this->changeColumn('whups_shares', 'share_id', 'integer', array('null' => false, 'autoincrement' => true)); + } + + /** + * Downgrade + */ + public function down() + { + $this->changeColumn('whups_shares', 'share_id', 'integer', array('null' => false)); + } +} diff --git a/whups/scripts/sql/whups.mssql.sql b/whups/scripts/sql/whups.mssql.sql deleted file mode 100644 index b6496bc8a..000000000 --- a/whups/scripts/sql/whups.mssql.sql +++ /dev/null @@ -1,224 +0,0 @@ --- --- Copyright 2001-2005 Robert E. Coyle --- --- See the enclosed file LICENSE for license information (BSD). If you --- did not receive this file, see http://www.horde.org/licenses/bsdl.php. --- --- Database definitions for Whups - -CREATE TABLE whups_tickets ( - ticket_id INT NOT NULL, -- unique ticket id - ticket_summary VARCHAR(255), -- summary of the ticket - user_id_requester VARCHAR(255) NOT NULL, -- user id of the creator of this ticket - queue_id INT NOT NULL, -- queue id that this ticket refers to - version_id INT, -- version id that this ticket refers to - type_id INT NOT NULL, -- id into the type table, describing the type of ticket - state_id INT NOT NULL, -- state of this ticket, meaning depends on the type of the ticket - priority_id INT NOT NULL, -- priority, meaning depends on the type of the ticket - ticket_timestamp INT NOT NULL, -- redundant but useful, mirrored in the comment and log - ticket_due INT, -- optional ticket due date - date_updated INT, -- date of last update - date_assigned INT, -- date of assignment - date_resolved INT, -- date of resolving --- - PRIMARY KEY (ticket_id) -); -CREATE INDEX whups_ticket_queue_idx ON whups_tickets (queue_id); -CREATE INDEX whups_ticket_state_idx ON whups_tickets (state_id); -CREATE INDEX whups_ticket_requester_idx ON whups_tickets (user_id_requester); -CREATE INDEX whups_ticket_version_idx ON whups_tickets (version_id); -CREATE INDEX whups_ticket_priority_idx ON whups_tickets (priority_id); - -CREATE TABLE whups_ticket_owners ( - ticket_id INT NOT NULL, - ticket_owner VARCHAR(255) NOT NULL --- - PRIMARY KEY (ticket_id, ticket_owner) -); -CREATE INDEX whups_ticket_owner_ticket_idx ON whups_ticket_owners (ticket_id); -CREATE INDEX whups_ticket_owner_owner_idx ON whups_ticket_owners (ticket_owner); - -CREATE TABLE whups_guests ( - guest_id VARCHAR(255) NOT NULL, - guest_email VARCHAR(255) NOT NULL, --- - PRIMARY KEY (guest_id) -); - -CREATE TABLE whups_queues ( - queue_id INT NOT NULL, - queue_name VARCHAR(64) NOT NULL, - queue_description VARCHAR(255), - queue_versioned SMALLINT DEFAULT 0 NOT NULL, - queue_slug VARCHAR(64), - queue_email VARCHAR(64), --- - PRIMARY KEY (queue_id) -); - -CREATE TABLE whups_queues_users ( - queue_id INT NOT NULL, - user_uid VARCHAR(250) NOT NULL, --- - PRIMARY KEY (queue_id, user_uid) -); - -CREATE TABLE whups_types ( - type_id INT NOT NULL, - type_name VARCHAR(64) NOT NULL, - type_description VARCHAR(255), --- - PRIMARY KEY (type_id) -); - -CREATE TABLE whups_types_queues ( - type_id INT NOT NULL, - queue_id INT NOT NULL, - type_default SMALLINT DEFAULT 0 NOT NULL -); -CREATE INDEX whups_type_queue_idx ON whups_types_queues (queue_id, type_id); - -CREATE TABLE whups_states ( - state_id INT NOT NULL, - type_id INT NOT NULL, - state_name VARCHAR(64) NOT NULL, - state_description VARCHAR(255), - state_category VARCHAR(16), - state_default SMALLINT DEFAULT 0 NOT NULL, --- - PRIMARY KEY (state_id) -); -CREATE INDEX whups_state_type_idx ON whups_states (type_id); -CREATE INDEX whups_state_category_idx ON whups_states (state_category); - -CREATE TABLE whups_replies ( - type_id INT NOT NULL, - reply_id INT NOT NULL, - reply_name VARCHAR(255) NOT NULL, - reply_text VARCHAR(MAX) NOT NULL, --- - PRIMARY KEY (reply_id) -); -CREATE INDEX whups_reply_type_idx ON whups_replies (type_id); -CREATE INDEX whups_reply_name_idx ON whups_replies (reply_name); - -CREATE TABLE whups_attributes_desc ( - attribute_id INT NOT NULL, - type_id INT NOT NULL, - attribute_name VARCHAR(64) NOT NULL, - attribute_description VARCHAR(255), - attribute_type VARCHAR(255) DEFAULT 'text' NOT NULL, - attribute_params VARCHAR(MAX), - attribute_required SMALLINT, --- - PRIMARY KEY (attribute_id) -); - -CREATE TABLE whups_attributes ( - ticket_id INT NOT NULL, - attribute_id INT NOT NULL, - attribute_value VARCHAR(255) -); - -CREATE TABLE whups_comments ( - comment_id INT NOT NULL, - ticket_id INT NOT NULL, - user_id_creator VARCHAR(255) NOT NULL, - comment_text VARCHAR(MAX), - comment_timestamp INT, --- - PRIMARY KEY (comment_id) -); -CREATE INDEX whups_comment_ticket_idx ON whups_comments (ticket_id); - -CREATE TABLE whups_logs ( - log_id INT NOT NULL, - transaction_id INT NOT NULL, - ticket_id INT NOT NULL, - log_timestamp INT NOT NULL, - log_type VARCHAR(255) NOT NULL, - log_value VARCHAR(255), - log_value_num INT, - user_id VARCHAR(255) NOT NULL, --- - PRIMARY KEY (log_id) -); - -CREATE INDEX whups_log_transaction_idx ON whups_logs (transaction_id); -CREATE INDEX whups_log_ticket_id_idx ON whups_logs (ticket_id); -CREATE INDEX whups_log_timestamp_idx ON whups_logs (log_timestamp); - -CREATE TABLE whups_priorities ( - priority_id INT NOT NULL, - type_id INT NOT NULL, - priority_name VARCHAR(64), - priority_description VARCHAR(255), - priority_default SMALLINT DEFAULT 0 NOT NULL, --- - PRIMARY KEY (priority_id) -); - -CREATE TABLE whups_versions ( - version_id INT NOT NULL, - queue_id INT NOT NULL, - version_name VARCHAR(64), - version_description VARCHAR(255), - version_active INT DEFAULT 1, --- - PRIMARY KEY (version_id) -); -CREATE INDEX whups_versions_active_idx ON whups_versions (version_active); - -CREATE TABLE whups_ticket_listeners ( - ticket_id INT NOT NULL, - user_uid VARCHAR(255) NOT NULL -); -CREATE INDEX whups_ticket_listeners_ticket_idx ON whups_ticket_listeners (ticket_id); - -CREATE TABLE whups_queries ( - query_id INT NOT NULL, - query_parameters VARCHAR(MAX), - query_object VARCHAR(MAX), --- - PRIMARY KEY (query_id) -); - -CREATE TABLE whups_shares ( - share_id INT NOT NULL, - share_name VARCHAR(255) NOT NULL, - share_owner VARCHAR(255) NOT NULL, - share_flags SMALLINT DEFAULT 0 NOT NULL, - perm_creator SMALLINT DEFAULT 0 NOT NULL, - perm_default SMALLINT DEFAULT 0 NOT NULL, - perm_guest SMALLINT DEFAULT 0 NOT NULL, - attribute_name VARCHAR(255) NOT NULL, - attribute_slug VARCHAR(255), --- - PRIMARY KEY (share_id) -); - -CREATE INDEX whups_shares_share_name_idx ON whups_shares (share_name); -CREATE INDEX whups_shares_share_owner_idx ON whups_shares (share_owner); -CREATE INDEX whups_shares_perm_creator_idx ON whups_shares (perm_creator); -CREATE INDEX whups_shares_perm_default_idx ON whups_shares (perm_default); -CREATE INDEX whups_shares_perm_guest_idx ON whups_shares (perm_guest); - -CREATE TABLE whups_shares_groups ( - share_id INT NOT NULL, - group_uid VARCHAR(255) NOT NULL, - perm SMALLINT NOT NULL -); - -CREATE INDEX whups_shares_groups_share_id_idx ON whups_shares_groups (share_id); -CREATE INDEX whups_shares_groups_group_uid_idx ON whups_shares_groups (group_uid); -CREATE INDEX whups_shares_groups_perm_idx ON whups_shares_groups (perm); - -CREATE TABLE whups_shares_users ( - share_id INT NOT NULL, - user_uid VARCHAR(255) NOT NULL, - perm SMALLINT NOT NULL -); - -CREATE INDEX whups_shares_users_share_id_idx ON whups_shares_users (share_id); -CREATE INDEX whups_shares_users_user_uid_idx ON whups_shares_users (user_uid); -CREATE INDEX whups_shares_users_perm_idx ON whups_shares_users (perm); diff --git a/whups/scripts/sql/whups.oci8.sql b/whups/scripts/sql/whups.oci8.sql deleted file mode 100644 index 2247822b0..000000000 --- a/whups/scripts/sql/whups.oci8.sql +++ /dev/null @@ -1,224 +0,0 @@ --- --- Copyright 2001-2005 Robert E. Coyle --- --- See the enclosed file LICENSE for license information (BSD). If you --- did not receive this file, see http://www.horde.org/licenses/bsdl.php. --- --- Database definitions for Whups - -CREATE TABLE whups_tickets ( - ticket_id NUMBER(16) NOT NULL, -- unique ticket id - ticket_summary VARCHAR2(255), -- summary of the ticket - user_id_requester VARCHAR2(255) NOT NULL, -- user id of the creator of this ticket - queue_id NUMBER(16) NOT NULL, -- queue id that this ticket refers to - version_id NUMBER(16), -- version id that this ticket refers to - type_id NUMBER(16) NOT NULL, -- id into the type table, describing the type of ticket - state_id NUMBER(16) NOT NULL, -- state of this ticket, meaning depends on the type of the ticket - priority_id NUMBER(16) NOT NULL, -- priority, meaning depends on the type of the ticket - ticket_timestamp NUMBER(16) NOT NULL, -- redundant but useful, mirrored in the comment and log - ticket_due NUMBER(16), -- optional ticket due date - date_updated NUMBER(16), -- date of last update - date_assigned NUMBER(16), -- date of assignment - date_resolved NUMBER(16), -- date of resolving --- - PRIMARY KEY (ticket_id) -); -CREATE INDEX whups_ticket_queue_idx ON whups_tickets (queue_id); -CREATE INDEX whups_ticket_state_idx ON whups_tickets (state_id); -CREATE INDEX whups_ticket_requester_idx ON whups_tickets (user_id_requester); -CREATE INDEX whups_ticket_version_idx ON whups_tickets (version_id); -CREATE INDEX whups_ticket_priority_idx ON whups_tickets (priority_id); - -CREATE TABLE whups_ticket_owners ( - ticket_id NUMBER(16) NOT NULL, - ticket_owner VARCHAR2(255) NOT NULL --- - PRIMARY KEY (ticket_id, ticket_owner) -); -CREATE INDEX whups_ticket_owner_ticket_idx ON whups_ticket_owners (ticket_id); -CREATE INDEX whups_ticket_owner_owner_idx ON whups_ticket_owners (ticket_owner); - -CREATE TABLE whups_guests ( - guest_id VARCHAR2(255) NOT NULL, - guest_email VARCHAR2(255) NOT NULL, --- - PRIMARY KEY (guest_id) -); - -CREATE TABLE whups_queues ( - queue_id NUMBER(16) NOT NULL, - queue_name VARCHAR2(64) NOT NULL, - queue_description VARCHAR2(255), - queue_versioned NUMBER(1) DEFAULT 0 NOT NULL, - queue_slug VARCHAR2(64), - queue_email VARCHAR2(64), --- - PRIMARY KEY (queue_id) -); - -CREATE TABLE whups_queues_users ( - queue_id NUMBER(16) NOT NULL, - user_uid VARCHAR2(255) NOT NULL, --- - PRIMARY KEY (queue_id, user_uid) -); - -CREATE TABLE whups_types ( - type_id NUMBER(16) NOT NULL, - type_name VARCHAR2(64) NOT NULL, - type_description VARCHAR2(255), --- - PRIMARY KEY (type_id) -); - -CREATE TABLE whups_types_queues ( - type_id NUMBER(16) NOT NULL, - queue_id NUMBER(16) NOT NULL, - type_default NUMBER(1) DEFAULT 0 NOT NULL -); -CREATE INDEX whups_type_queue_idx ON whups_types_queues (queue_id, type_id); - -CREATE TABLE whups_states ( - state_id NUMBER(16) NOT NULL, - type_id NUMBER(16) NOT NULL, - state_name VARCHAR2(64) NOT NULL, - state_description VARCHAR2(255), - state_category VARCHAR2(16), - state_default NUMBER(1) DEFAULT 0 NOT NULL, --- - PRIMARY KEY (state_id) -); -CREATE INDEX whups_state_type_idx ON whups_states (type_id); -CREATE INDEX whups_state_category_idx ON whups_states (state_category); - -CREATE TABLE whups_replies ( - type_id NUMBER(16) NOT NULL, - reply_id NUMBER(16) NOT NULL, - reply_name VARCHAR2(255) NOT NULL, - reply_text CLOB NOT NULL, --- - PRIMARY KEY (reply_id) -); -CREATE INDEX whups_reply_type_idx ON whups_replies (type_id); -CREATE INDEX whups_reply_name_idx ON whups_replies (reply_name); - -CREATE TABLE whups_attributes_desc ( - attribute_id NUMBER(16) NOT NULL, - type_id NUMBER(16) NOT NULL, - attribute_name VARCHAR2(64) NOT NULL, - attribute_description VARCHAR2(255), - attribute_type VARCHAR2(255) DEFAULT 'text' NOT NULL, - attribute_params CLOB, - attribute_required NUMBER(8), --- - PRIMARY KEY (attribute_id) -); - -CREATE TABLE whups_attributes ( - ticket_id NUMBER(16) NOT NULL, - attribute_id NUMBER(16) NOT NULL, - attribute_value VARCHAR2(255) -); - -CREATE TABLE whups_comments ( - comment_id NUMBER(16) NOT NULL, - ticket_id NUMBER(16) NOT NULL, - user_id_creator VARCHAR2(255) NOT NULL, - comment_text CLOB, - comment_timestamp NUMBER(16), --- - PRIMARY KEY (comment_id) -); -CREATE INDEX whups_comment_ticket_idx ON whups_comments (ticket_id); - -CREATE TABLE whups_logs ( - log_id NUMBER(16) NOT NULL, - transaction_id NUMBER(16) NOT NULL, - ticket_id NUMBER(16) NOT NULL, - log_timestamp NUMBER(16) NOT NULL, - log_type VARCHAR2(255) NOT NULL, - log_value VARCHAR2(255), - log_value_num NUMBER(16), - user_id VARCHAR2(255) NOT NULL, --- - PRIMARY KEY (log_id) -); - -CREATE INDEX whups_log_transaction_idx ON whups_logs (transaction_id); -CREATE INDEX whups_log_ticket_id_idx ON whups_logs (ticket_id); -CREATE INDEX whups_log_timestamp_idx ON whups_logs (log_timestamp); - -CREATE TABLE whups_priorities ( - priority_id NUMBER(16) NOT NULL, - type_id NUMBER(16) NOT NULL, - priority_name VARCHAR2(64), - priority_description VARCHAR2(255), - priority_default NUMBER(1) DEFAULT 0 NOT NULL, --- - PRIMARY KEY (priority_id) -); - -CREATE TABLE whups_versions ( - version_id NUMBER(16) NOT NULL, - queue_id NUMBER(16) NOT NULL, - version_name VARCHAR2(64), - version_description VARCHAR2(255), - version_active NUMBER(1) DEFAULT 1, --- - PRIMARY KEY (version_id) -); -CREATE INDEX whups_versions_active_idx ON whups_versions (version_active); - -CREATE TABLE whups_ticket_listeners ( - ticket_id NUMBER(16) NOT NULL, - user_uid VARCHAR2(255) NOT NULL -); -CREATE INDEX whups_ticket_listeners_ticket_idx ON whups_ticket_listeners (ticket_id); - -CREATE TABLE whups_queries ( - query_id NUMBER(16) NOT NULL, - query_parameters CLOB, - query_object CLOB, --- - PRIMARY KEY (query_id) -); - -CREATE TABLE whups_shares ( - share_id NUMBER(16) NOT NULL, - share_name VARCHAR2(255) NOT NULL, - share_owner VARCHAR2(255) NOT NULL, - share_flags NUMBER(8) DEFAULT 0 NOT NULL, - perm_creator NUMBER(8) DEFAULT 0 NOT NULL, - perm_default NUMBER(8) DEFAULT 0 NOT NULL, - perm_guest NUMBER(8) DEFAULT 0 NOT NULL, - attribute_name VARCHAR2(255) NOT NULL, - attribute_slug VARCHAR2(255), --- - PRIMARY KEY (share_id) -); - -CREATE INDEX whups_shares_share_name_idx ON whups_shares (share_name); -CREATE INDEX whups_shares_share_owner_idx ON whups_shares (share_owner); -CREATE INDEX whups_shares_perm_creator_idx ON whups_shares (perm_creator); -CREATE INDEX whups_shares_perm_default_idx ON whups_shares (perm_default); -CREATE INDEX whups_shares_perm_guest_idx ON whups_shares (perm_guest); - -CREATE TABLE whups_shares_groups ( - share_id NUMBER(16) NOT NULL, - group_uid VARCHAR2(255) NOT NULL, - perm NUMBER(8) NOT NULL -); - -CREATE INDEX whups_shares_groups_share_id_idx ON whups_shares_groups (share_id); -CREATE INDEX whups_shares_groups_group_uid_idx ON whups_shares_groups (group_uid); -CREATE INDEX whups_shares_groups_perm_idx ON whups_shares_groups (perm); - -CREATE TABLE whups_shares_users ( - share_id NUMBER(16) NOT NULL, - user_uid VARCHAR2(255) NOT NULL, - perm NUMBER(8) NOT NULL -); - -CREATE INDEX whups_shares_users_share_id_idx ON whups_shares_users (share_id); -CREATE INDEX whups_shares_users_user_uid_idx ON whups_shares_users (user_uid); -CREATE INDEX whups_shares_users_perm_idx ON whups_shares_users (perm); diff --git a/whups/scripts/sql/whups.sql b/whups/scripts/sql/whups.sql deleted file mode 100644 index ef474ab7c..000000000 --- a/whups/scripts/sql/whups.sql +++ /dev/null @@ -1,224 +0,0 @@ --- --- Copyright 2001-2005 Robert E. Coyle --- --- See the enclosed file LICENSE for license information (BSD). If you --- did not receive this file, see http://www.horde.org/licenses/bsdl.php. --- --- Database definitions for Whups - -CREATE TABLE whups_tickets ( - ticket_id INT NOT NULL, -- unique ticket id - ticket_summary VARCHAR(255), -- summary of the ticket - user_id_requester VARCHAR(255) NOT NULL, -- user id of the creator of this ticket - queue_id INT NOT NULL, -- queue id that this ticket refers to - version_id INT, -- version id that this ticket refers to - type_id INT NOT NULL, -- id into the type table, describing the type of ticket - state_id INT NOT NULL, -- state of this ticket, meaning depends on the type of the ticket - priority_id INT NOT NULL, -- priority, meaning depends on the type of the ticket - ticket_timestamp INT NOT NULL, -- redundant but useful, mirrored in the comment and log - ticket_due INT, -- optional ticket due date - date_updated INT, -- date of last update - date_assigned INT, -- date of assignment - date_resolved INT, -- date of resolving --- - PRIMARY KEY (ticket_id) -); -CREATE INDEX whups_ticket_queue_idx ON whups_tickets (queue_id); -CREATE INDEX whups_ticket_state_idx ON whups_tickets (state_id); -CREATE INDEX whups_ticket_requester_idx ON whups_tickets (user_id_requester); -CREATE INDEX whups_ticket_version_idx ON whups_tickets (version_id); -CREATE INDEX whups_ticket_priority_idx ON whups_tickets (priority_id); - -CREATE TABLE whups_ticket_owners ( - ticket_id INT NOT NULL, - ticket_owner VARCHAR(255) NOT NULL, --- - PRIMARY KEY (ticket_id, ticket_owner) -); -CREATE INDEX whups_ticket_owner_ticket_idx ON whups_ticket_owners (ticket_id); -CREATE INDEX whups_ticket_owner_owner_idx ON whups_ticket_owners (ticket_owner); - -CREATE TABLE whups_guests ( - guest_id VARCHAR(255) NOT NULL, - guest_email VARCHAR(255) NOT NULL, --- - PRIMARY KEY (guest_id) -); - -CREATE TABLE whups_queues ( - queue_id INT NOT NULL, - queue_name VARCHAR(64) NOT NULL, - queue_description VARCHAR(255), - queue_versioned SMALLINT DEFAULT 0 NOT NULL, - queue_slug VARCHAR(64), - queue_email VARCHAR(64), --- - PRIMARY KEY (queue_id) -); - -CREATE TABLE whups_queues_users ( - queue_id INT NOT NULL, - user_uid VARCHAR(250) NOT NULL, --- - PRIMARY KEY (queue_id, user_uid) -); - -CREATE TABLE whups_types ( - type_id INT NOT NULL, - type_name VARCHAR(64) NOT NULL, - type_description VARCHAR(255), --- - PRIMARY KEY (type_id) -); - -CREATE TABLE whups_types_queues ( - type_id INT NOT NULL, - queue_id INT NOT NULL, - type_default SMALLINT DEFAULT 0 NOT NULL -); -CREATE INDEX whups_type_queue_idx ON whups_types_queues (queue_id, type_id); - -CREATE TABLE whups_states ( - state_id INT NOT NULL, - type_id INT NOT NULL, - state_name VARCHAR(64) NOT NULL, - state_description VARCHAR(255), - state_category VARCHAR(16), - state_default SMALLINT DEFAULT 0 NOT NULL, --- - PRIMARY KEY (state_id) -); -CREATE INDEX whups_state_type_idx ON whups_states (type_id); -CREATE INDEX whups_state_category_idx ON whups_states (state_category); - -CREATE TABLE whups_replies ( - type_id INT NOT NULL, - reply_id INT NOT NULL, - reply_name VARCHAR(255) NOT NULL, - reply_text TEXT NOT NULL, --- - PRIMARY KEY (reply_id) -); -CREATE INDEX whups_reply_type_idx ON whups_replies (type_id); -CREATE INDEX whups_reply_name_idx ON whups_replies (reply_name); - -CREATE TABLE whups_attributes_desc ( - attribute_id INT NOT NULL, - type_id INT NOT NULL, - attribute_name VARCHAR(64) NOT NULL, - attribute_description VARCHAR(255), - attribute_type VARCHAR(255) DEFAULT 'text' NOT NULL, - attribute_params TEXT, - attribute_required SMALLINT, --- - PRIMARY KEY (attribute_id) -); - -CREATE TABLE whups_attributes ( - ticket_id INT NOT NULL, - attribute_id INT NOT NULL, - attribute_value VARCHAR(255) -); - -CREATE TABLE whups_comments ( - comment_id INT NOT NULL, - ticket_id INT NOT NULL, - user_id_creator VARCHAR(255) NOT NULL, - comment_text TEXT, - comment_timestamp INT, --- - PRIMARY KEY (comment_id) -); -CREATE INDEX whups_comment_ticket_idx ON whups_comments (ticket_id); - -CREATE TABLE whups_logs ( - log_id INT NOT NULL, - transaction_id INT NOT NULL, - ticket_id INT NOT NULL, - log_timestamp INT NOT NULL, - log_type VARCHAR(255) NOT NULL, - log_value VARCHAR(255), - log_value_num INT, - user_id VARCHAR(255) NOT NULL, --- - PRIMARY KEY (log_id) -); -CREATE INDEX whups_log_transaction_idx ON whups_logs (transaction_id); -CREATE INDEX whups_log_ticket_id_idx ON whups_logs (ticket_id); -CREATE INDEX whups_log_timestamp_idx ON whups_logs (log_timestamp); - -CREATE TABLE whups_priorities ( - priority_id INT NOT NULL, - type_id INT NOT NULL, - priority_name VARCHAR(64), - priority_description VARCHAR(255), - priority_default SMALLINT DEFAULT 0 NOT NULL, --- - PRIMARY KEY (priority_id) -); -CREATE INDEX whups_priority_type_idx ON whups_priorities (type_id); - -CREATE TABLE whups_versions ( - version_id INT NOT NULL, - queue_id INT NOT NULL, - version_name VARCHAR(64), - version_description VARCHAR(255), - version_active INT DEFAULT 1, --- - PRIMARY KEY (version_id) -); -CREATE INDEX whups_versions_active_idx ON whups_versions (version_active); - -CREATE TABLE whups_ticket_listeners ( - ticket_id INT NOT NULL, - user_uid VARCHAR(255) NOT NULL -); -CREATE INDEX whups_ticket_listeners_ticket_idx ON whups_ticket_listeners (ticket_id); - -CREATE TABLE whups_queries ( - query_id INT NOT NULL, - query_parameters TEXT, - query_object TEXT, --- - PRIMARY KEY (query_id) -); - -CREATE TABLE whups_shares ( - share_id INT NOT NULL, - share_name VARCHAR(255) NOT NULL, - share_owner VARCHAR(255) NOT NULL, - share_flags SMALLINT DEFAULT 0 NOT NULL, - perm_creator SMALLINT DEFAULT 0 NOT NULL, - perm_default SMALLINT DEFAULT 0 NOT NULL, - perm_guest SMALLINT DEFAULT 0 NOT NULL, - attribute_name VARCHAR(255) NOT NULL, - attribute_slug VARCHAR(255), --- - PRIMARY KEY (share_id) -); - -CREATE INDEX whups_shares_share_name_idx ON whups_shares (share_name); -CREATE INDEX whups_shares_share_owner_idx ON whups_shares (share_owner); -CREATE INDEX whups_shares_perm_creator_idx ON whups_shares (perm_creator); -CREATE INDEX whups_shares_perm_default_idx ON whups_shares (perm_default); -CREATE INDEX whups_shares_perm_guest_idx ON whups_shares (perm_guest); - -CREATE TABLE whups_shares_groups ( - share_id INT NOT NULL, - group_uid VARCHAR(255) NOT NULL, - perm SMALLINT NOT NULL -); - -CREATE INDEX whups_shares_groups_share_id_idx ON whups_shares_groups (share_id); -CREATE INDEX whups_shares_groups_group_uid_idx ON whups_shares_groups (group_uid); -CREATE INDEX whups_shares_groups_perm_idx ON whups_shares_groups (perm); - -CREATE TABLE whups_shares_users ( - share_id INT NOT NULL, - user_uid VARCHAR(255) NOT NULL, - perm SMALLINT NOT NULL -); - -CREATE INDEX whups_shares_users_share_id_idx ON whups_shares_users (share_id); -CREATE INDEX whups_shares_users_user_uid_idx ON whups_shares_users (user_uid); -CREATE INDEX whups_shares_users_perm_idx ON whups_shares_users (perm); diff --git a/whups/scripts/sql/whups.xml b/whups/scripts/sql/whups.xml deleted file mode 100644 index 291106f89..000000000 --- a/whups/scripts/sql/whups.xml +++ /dev/null @@ -1,1368 +0,0 @@ - - - - name - false - false - - - - whups_attributes - - - - - ticket_id - integer - 0 - true - 4 - - - - attribute_id - integer - 0 - true - 4 - - - - attribute_value - text - - false - 255 - - - - -
- - - - whups_attributes_desc - - - - - attribute_id - integer - 0 - true - 4 - - - - type_id - integer - 0 - true - 4 - - - - attribute_name - text - - true - 64 - - - - attribute_description - text - - false - 255 - - - - attribute_type - text - text - false - 255 - - - - attribute_required - integer - - false - 4 - - - - attribute_params - text - - false - - - - whups_attributes_desc_pKey - true - - attribute_id - ascending - - - - - -
- - - - whups_comments - - - - - comment_id - integer - 0 - true - 4 - - - - ticket_id - integer - 0 - true - 4 - - - - user_id_creator - text - - true - 255 - - - - comment_text - text - - false - - - - comment_timestamp - integer - - false - 4 - - - - whups_comment_ticket - - ticket_id - ascending - - - - - whups_comments_pKey - true - - comment_id - ascending - - - - - -
- - - - whups_guests - - - - - guest_id - text - - true - 255 - - - - guest_email - text - - true - 255 - - - - whups_guests_pKey - true - - guest_id - ascending - - - - - -
- - - - whups_logs - - - - - ticket_id - integer - 0 - true - 4 - - - - log_timestamp - integer - 0 - true - 4 - - - - user_id - text - - true - 255 - - - - log_type - text - - false - 255 - - - - log_value - text - - false - 255 - - - - log_id - integer - - false - 4 - - - - transaction_id - integer - - false - 4 - - - - log_value_num - integer - - false - 4 - - - - log_ticket_id - - ticket_id - ascending - - - - - log_timestamp - - log_timestamp - ascending - - - - - -
- - - - whups_priorities - - - - - priority_id - integer - 0 - true - 4 - - - - type_id - integer - 0 - true - 4 - - - - priority_name - text - - false - 64 - - - - priority_description - text - - false - 255 - - - - priority_default - integer - 0 - true - 2 - - - - whups_priority_type - - type_id - ascending - - - - - whups_priorities_pKey - true - - priority_id - ascending - - - - - -
- - - - whups_queries - - - - - query_id - integer - - true - 4 - - - - query_parameters - text - - false - - - - query_object - text - - false - - - - whups_queries_pKey - true - - query_id - ascending - - - - - -
- - - - whups_queues - - - - - queue_id - integer - 0 - true - 4 - - - - queue_name - text - - true - 64 - - - - queue_description - text - - false - 255 - - - - queue_versioned - integer - 0 - true - 2 - - - - queue_slug - text - - false - 64 - - - - queue_email - text - - false - 64 - - - - whups_queue_slug - - queue_slug - ascending - - - - - whups_queues_pKey - true - - queue_id - ascending - - - - - -
- - - - whups_queues_users - - - - - queue_id - integer - 0 - true - 4 - - - - user_uid - text - - true - 250 - - - - whups_queues_users_pKey - true - - queue_id - ascending - - - user_uid - ascending - - - - - -
- - - - whups_replies - - - - - type_id - integer - - true - 4 - - - - reply_id - integer - - true - 4 - - - - reply_name - text - - true - 255 - - - - reply_text - text - - true - - - - whups_reply_type - - type_id - ascending - - - - - whups_reply_name - - reply_name - ascending - - - - - whups_replies_pKey - true - - reply_id - ascending - - - - - -
- - - - whups_shares - - - - - share_id - integer - - true - 4 - - - - share_name - text - - true - 255 - - - - share_owner - text - - true - 32 - - - - share_flags - integer - 0 - true - 2 - - - - perm_creator - integer - 0 - true - 2 - - - - perm_default - integer - 0 - true - 2 - - - - perm_guest - integer - 0 - true - 2 - - - - attribute_name - text - - true - 255 - - - - attribute_slug - text - - false - 255 - - - - whups_shares_share_name - - share_name - ascending - - - - - whups_shares_share_owner - - share_owner - ascending - - - - - whups_shares_perm_creator - - perm_creator - ascending - - - - - whups_shares_perm_default - - perm_default - ascending - - - - - whups_shares_perm_guest - - perm_guest - ascending - - - - - whups_shares_pKey - true - - share_id - ascending - - - - - -
- - - - whups_shares_groups - - - - - share_id - integer - - true - 4 - - - - group_uid - text - - true - 255 - - - - perm - integer - - true - 2 - - - - whups_shares_groups_share_id - - share_id - ascending - - - - - whups_shares_groups_group_uid - - group_uid - ascending - - - - - whups_shares_groups_perm - - perm - ascending - - - - - -
- - - - whups_shares_users - - - - - share_id - integer - - true - 4 - - - - user_uid - text - - true - 32 - - - - perm - integer - - true - 2 - - - - whups_shares_users_share_id - - share_id - ascending - - - - - whups_shares_users_user_uid - - user_uid - ascending - - - - - whups_shares_users_perm - - perm - ascending - - - - - -
- - - - whups_states - - - - - state_id - integer - 0 - true - 4 - - - - type_id - integer - 0 - true - 4 - - - - state_name - text - - true - 64 - - - - state_description - text - - false - 255 - - - - state_category - text - - false - 16 - - - - state_default - integer - 0 - true - 2 - - - - whups_state_type - - type_id - ascending - - - - - whups_state_category - - state_category - ascending - - - - - whups_states_pKey - true - - state_id - ascending - - - - - -
- - - - whups_ticket_listeners - - - - - ticket_id - integer - - true - 4 - - - - user_uid - text - - true - 255 - - - - whups_ticket_listeners_ticket - - ticket_id - ascending - - - - - -
- - - - whups_ticket_owners - - - - - ticket_id - integer - 0 - true - 4 - - - - ticket_owner - text - - true - 255 - - - - ticket_id - - ticket_id - ascending - - - - - ticket_owner - - ticket_owner - ascending - - - - - whups_ticket_owner_ticket - - ticket_id - ascending - - - - - whups_ticket_owner_owner - - ticket_owner - ascending - - - - - -
- - - - whups_tickets - - - - - ticket_id - integer - 0 - true - 4 - - - - ticket_summary - text - - false - 255 - - - - user_id_requester - text - - true - 255 - - - - queue_id - integer - 0 - true - 4 - - - - version_id - integer - - false - 4 - - - - type_id - integer - 0 - true - 4 - - - - state_id - integer - 0 - true - 4 - - - - priority_id - integer - 0 - true - 4 - - - - ticket_timestamp - integer - 0 - true - 4 - - - - ticket_due - integer - - false - 4 - - - - date_updated - integer - - false - 4 - - - - date_assigned - integer - - false - 4 - - - - date_resolved - integer - - false - 4 - - - - whups_ticket_queue - - queue_id - ascending - - - - - whups_ticket_state - - state_id - ascending - - - - - whups_ticket_requester - - user_id_requester - ascending - - - - - whups_ticket_version - - version_id - ascending - - - - - whups_ticket_priority - - priority_id - ascending - - - - - whups_tickets_pKey - true - - ticket_id - ascending - - - - - -
- - - - whups_types - - - - - type_id - integer - 0 - true - 4 - - - - type_name - text - - true - 64 - - - - type_description - text - - false - 255 - - - - whups_types_pKey - true - - type_id - ascending - - - - - -
- - - - whups_types_queues - - - - - type_id - integer - 0 - true - 4 - - - - queue_id - integer - 0 - true - 4 - - - - type_default - integer - 0 - true - 2 - - - - whups_type_queue - - queue_id - ascending - - - type_id - ascending - - - - - -
- - - - whups_users_queries - - - - - user_uid - text - - true - 255 - - - - query_name - text - - false - 255 - - - - query_object - text - - false - - - - -
- - - - whups_versions - - - - - version_id - integer - - true - 4 - - - - queue_id - integer - - true - 4 - - - - version_name - text - - false - 64 - - - - version_description - text - - false - 255 - - - - version_active - integer - 1 - 1 - - - - whups_versions_pKey - true - - version_id - ascending - - - - - whups_versions_active - - version_active - ascending - - - - - -
- -
diff --git a/whups/scripts/upgrades/2006-07-12_add_due_date.sql b/whups/scripts/upgrades/2006-07-12_add_due_date.sql deleted file mode 100644 index 131ebe61b..000000000 --- a/whups/scripts/upgrades/2006-07-12_add_due_date.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Script to add due date to whups_tickets table - -ALTER TABLE whups_tickets ADD ticket_due INT; diff --git a/whups/scripts/upgrades/2006-08-04_drop_subjectlist.sql b/whups/scripts/upgrades/2006-08-04_drop_subjectlist.sql deleted file mode 100644 index 840c8a995..000000000 --- a/whups/scripts/upgrades/2006-08-04_drop_subjectlist.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE whups_queues_subjects; -DROP TABLE whups_subjects; -ALTER TABLE whups_queues DROP COLUMN queue_subjectlist; -DROP TABLE whups_subjects_seq; diff --git a/whups/scripts/upgrades/2008-02-27_add_defaults.sql b/whups/scripts/upgrades/2008-02-27_add_defaults.sql deleted file mode 100644 index e2408ae84..000000000 --- a/whups/scripts/upgrades/2008-02-27_add_defaults.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE whups_types_queues ADD COLUMN type_default SMALLINT DEFAULT 0 NOT NULL; -ALTER TABLE whups_states ADD COLUMN state_default SMALLINT DEFAULT 0 NOT NULL; -ALTER TABLE whups_priorities ADD COLUMN priority_default SMALLINT DEFAULT 0 NOT NULL; diff --git a/whups/scripts/upgrades/2008-04-29_add_sql_share_tables.sql b/whups/scripts/upgrades/2008-04-29_add_sql_share_tables.sql deleted file mode 100644 index 634a4bbcd..000000000 --- a/whups/scripts/upgrades/2008-04-29_add_sql_share_tables.sql +++ /dev/null @@ -1,37 +0,0 @@ -CREATE TABLE whups_shares ( - share_id INT NOT NULL, - share_name VARCHAR(255) NOT NULL, - share_owner VARCHAR(255) NOT NULL, - share_flags SMALLINT DEFAULT 0 NOT NULL, - perm_creator SMALLINT DEFAULT 0 NOT NULL, - perm_default SMALLINT DEFAULT 0 NOT NULL, - perm_guest SMALLINT DEFAULT 0 NOT NULL, - attribute_name VARCHAR(255) NOT NULL, - PRIMARY KEY (share_id) -); - -CREATE INDEX whups_shares_share_name_idx ON whups_shares (share_name); -CREATE INDEX whups_shares_share_owner_idx ON whups_shares (share_owner); -CREATE INDEX whups_shares_perm_creator_idx ON whups_shares (perm_creator); -CREATE INDEX whups_shares_perm_default_idx ON whups_shares (perm_default); -CREATE INDEX whups_shares_perm_guest_idx ON whups_shares (perm_guest); - -CREATE TABLE whups_shares_groups ( - share_id INT NOT NULL, - group_uid INT NOT NULL, - perm SMALLINT NOT NULL -); - -CREATE INDEX whups_shares_groups_share_id_idx ON whups_shares_groups (share_id); -CREATE INDEX whups_shares_groups_group_uid_idx ON whups_shares_groups (group_uid); -CREATE INDEX whups_shares_groups_perm_idx ON whups_shares_groups (perm); - -CREATE TABLE whups_shares_users ( - share_id INT NOT NULL, - user_uid VARCHAR(32) NOT NULL, - perm SMALLINT NOT NULL -); - -CREATE INDEX whups_shares_users_share_id_idx ON whups_shares_users (share_id); -CREATE INDEX whups_shares_users_user_uid_idx ON whups_shares_users (user_uid); -CREATE INDEX whups_shares_users_perm_idx ON whups_shares_users (perm); diff --git a/whups/scripts/upgrades/2008-06-11_add_attribute_types.oci8.sql b/whups/scripts/upgrades/2008-06-11_add_attribute_types.oci8.sql deleted file mode 100644 index 7138887cb..000000000 --- a/whups/scripts/upgrades/2008-06-11_add_attribute_types.oci8.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_description_new VARCHAR2(255); -UPDATE whups_attributes_desc SET attribute_description_new = attribute_description; -ALTER TABLE whups_attributes_desc DROP COLUMN attribute_description; -ALTER TABLE whups_attributes_desc RENAME COLUMN attribute_description_new TO attribute_description; -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_type VARCHAR2(255) DEFAULT 'text'; -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_params CLOB; -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_required NUMBER(8); diff --git a/whups/scripts/upgrades/2008-06-11_add_attribute_types.pgsql.sql b/whups/scripts/upgrades/2008-06-11_add_attribute_types.pgsql.sql deleted file mode 100644 index 1f9edc3ac..000000000 --- a/whups/scripts/upgrades/2008-06-11_add_attribute_types.pgsql.sql +++ /dev/null @@ -1,14 +0,0 @@ -BEGIN; -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_description_new VARCHAR(255); -UPDATE whups_attributes_desc SET attribute_description_new = attribute_description; -ALTER TABLE whups_attributes_desc DROP attribute_description; -ALTER TABLE whups_attributes_desc RENAME attribute_description_new TO attribute_description; -COMMIT; - -BEGIN; -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_type VARCHAR(255); -ALTER TABLE whups_attributes_desc ALTER COLUMN attribute_type SET DEFAULT 'text'; -COMMIT; - -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_params TEXT; -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_required SMALLINT; diff --git a/whups/scripts/upgrades/2008-06-11_add_attribute_types.sql b/whups/scripts/upgrades/2008-06-11_add_attribute_types.sql deleted file mode 100644 index 78b48f8a1..000000000 --- a/whups/scripts/upgrades/2008-06-11_add_attribute_types.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE whups_attributes_desc CHANGE COLUMN attribute_description attribute_description VARCHAR(255); -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_type VARCHAR(255) DEFAULT 'text'; -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_params TEXT; -ALTER TABLE whups_attributes_desc ADD COLUMN attribute_required SMALLINT; diff --git a/whups/scripts/upgrades/2008-06-13_add_queue_emails.sql b/whups/scripts/upgrades/2008-06-13_add_queue_emails.sql deleted file mode 100644 index 325b18457..000000000 --- a/whups/scripts/upgrades/2008-06-13_add_queue_emails.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE whups_queues ADD COLUMN queue_email VARCHAR(64); diff --git a/whups/scripts/upgrades/2008-06-17_fix_varchar_lengths.sql b/whups/scripts/upgrades/2008-06-17_fix_varchar_lengths.sql deleted file mode 100644 index 48f65288e..000000000 --- a/whups/scripts/upgrades/2008-06-17_fix_varchar_lengths.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE whups_shares CHANGE share_owner share_owner VARCHAR(255); -ALTER TABLE whups_shares_users CHANGE user_uid user_uid VARCHAR(255); \ No newline at end of file diff --git a/whups/scripts/upgrades/2008-06-24_add_replies.sql b/whups/scripts/upgrades/2008-06-24_add_replies.sql deleted file mode 100644 index b3bb7bdf2..000000000 --- a/whups/scripts/upgrades/2008-06-24_add_replies.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE whups_replies ( - type_id INT NOT NULL, - reply_id INT NOT NULL, - reply_name VARCHAR(255) NOT NULL, - reply_text TEXT NOT NULL, --- - PRIMARY KEY (reply_id) -); -CREATE INDEX whups_reply_type_idx ON whups_replies (type_id); -CREATE INDEX whups_reply_name_idx ON whups_replies (reply_name); diff --git a/whups/scripts/upgrades/2008-07-10_add_query_slugs.sql b/whups/scripts/upgrades/2008-07-10_add_query_slugs.sql deleted file mode 100644 index 524762fcd..000000000 --- a/whups/scripts/upgrades/2008-07-10_add_query_slugs.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE whups_shares ADD COLUMN attribute_slug VARCHAR(255); diff --git a/whups/scripts/upgrades/2008-09-23_fix_group_uid.sql b/whups/scripts/upgrades/2008-09-23_fix_group_uid.sql deleted file mode 100644 index 410d9923c..000000000 --- a/whups/scripts/upgrades/2008-09-23_fix_group_uid.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE whups_shares_groups CHANGE group_uid group_uid VARCHAR(255); - diff --git a/whups/scripts/upgrades/2009-09-07_add_version_active.pgsql.sql b/whups/scripts/upgrades/2009-09-07_add_version_active.pgsql.sql deleted file mode 100644 index 6de2a2ffc..000000000 --- a/whups/scripts/upgrades/2009-09-07_add_version_active.pgsql.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE whups_versions ADD COLUMN version_active INT; -UPDATE whups_versions SET version_active = 1; -ALTER TABLE whups_versions ALTER COLUMN version_active SET DEFAULT 1; -CREATE INDEX whups_versions_active_idx ON whups_versions (version_active); diff --git a/whups/scripts/upgrades/2009-09-07_add_version_active.sql b/whups/scripts/upgrades/2009-09-07_add_version_active.sql deleted file mode 100644 index c192a1f36..000000000 --- a/whups/scripts/upgrades/2009-09-07_add_version_active.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE whups_versions ADD COLUMN version_active INT DEFAULT 1; -CREATE INDEX whups_versions_active_idx ON whups_versions (version_active); -- 2.11.0