Author: dabbous
Date: 2006-06-09 13:20:51-0700
New Revision: 10158
Modified:
branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-1.sql
branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-2.sql
branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-3.sql
Log:
fixed some issues with batch file syntax for MySQL-4.1 RDB engines,
mainly changed the comments syntax in the upgrade sql-scripts from
java style "/* ... */" to sql style "-- ..."
and added some code to prevent MySQL from checking for foreign key
constraints during table creation.
Modified: branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-1.sql
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-1.sql?view=diff&rev=10158&p1=branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-1.sql&p2=branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-1.sql&r1=10157&r2=10158
==============================================================================
--- branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-1.sql (original)
+++ branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-1.sql 2006-06-09 13:20:51-0700
@@ -1,35 +1,34 @@
-/*
- * b20-b21 Migration.
- *
- * Creates new fields to allow deleting issues
- * Creates new permissions for commenting and deleting issues
- *
- */
+--
+-- b20-b21 Migration.
+--
+-- Creates new fields to allow deleting issues
+-- Creates new permissions for commenting and deleting issues
+--
-/**
- * Adds the field to describe ActivityType for every activity record.
- */
+--
+-- Adds the field to describe ActivityType for every activity record.
+--
ALTER TABLE SCARAB_ACTIVITY ADD ACTIVITY_TYPE varchar(30) null;
-/**
- * Adds the field to mark an issue as 'moved'. The 'deleted' will now be
- * used just for the deletions.
- */
+--
+-- Adds the field to mark an issue as 'moved'. The 'deleted' will now be
+-- used just for the deletions.
+--
ALTER TABLE SCARAB_ISSUE ADD MOVED INTEGER(1);
-/**
- * Move the 'deleted' values into 'moved' field.
- */
+--
+-- Move the 'deleted' values into 'moved' field.
+--
update SCARAB_ISSUE SET MOVED=DELETED;
-/**
- * Reset the 'deleted' issue.
- */
+--
+-- Reset the 'deleted' issue.
+--
update SCARAB_ISSUE SET DELETED=0;
-/**
- * Insert new permissions (delete & comment)
- */
+--
+-- Insert new permissions (delete & comment)
+--
INSERT INTO TURBINE_PERMISSION (PERMISSION_ID, PERMISSION_NAME) VALUES (21, 'Issue | Comment');
INSERT INTO TURBINE_PERMISSION (PERMISSION_ID, PERMISSION_NAME) VALUES (20, 'Issue | Delete');
Modified: branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-2.sql
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-2.sql?view=diff&rev=10158&p1=branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-2.sql&p2=branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-2.sql&r1=10157&r2=10158
==============================================================================
--- branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-2.sql (original)
+++ branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-2.sql 2006-06-09 13:20:51-0700
@@ -1,15 +1,15 @@
-/*
- * b20-b21 Migration.
- *
- * Creates new tables for the notification system.
- *
- */
+--
+-- b20-b21 Migration.
+--
+-- Creates new tables for the notification system.
+--
+SET FOREIGN_KEY_CHECKS = 0;
+
+--
+-- SCARAB_NOTIFICATION_STATUS
+--
-/*
- * SCARAB_NOTIFICATION_STATUS
- *
- */
CREATE TABLE SCARAB_NOTIFICATION_STATUS
(
ACTIVITY_ID BIGINT NOT NULL,
@@ -26,10 +26,10 @@
INDEX IX_NOTIF_STATUS (STATUS)
);
-/*
- * SCARAB_NOTIFICATION_FILTER
- *
- */
+--
+-- SCARAB_NOTIFICATION_FILTER
+--
+
CREATE TABLE SCARAB_NOTIFICATION_FILTER
(
MODULE_ID MEDIUMINT NOT NULL,
@@ -44,10 +44,10 @@
FOREIGN KEY (MODULE_ID) REFERENCES SCARAB_MODULE (MODULE_ID)
);
-/*
- * SCARAB_DEFAULT_NOTIFICATION_FILTER
- *
- */
+--
+-- SCARAB_DEFAULT_NOTIFICATION_FILTER
+--
+
CREATE TABLE SCARAB_DEFAULT_NOTIFICATION_FILTER (
MODULE_ID mediumint(9) NOT NULL,
ROLE_ID mediumint(9) NOT NULL,
@@ -57,3 +57,5 @@
MODIFYABlE int(1) NOT NULL default '1',
PRIMARY KEY (MODULE_ID,ROLE_ID,ACTIVITY_TYPE,MANAGER_ID)
);
+
+SET FOREIGN_KEY_CHECKS = 1;
Modified: branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-3.sql
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-3.sql?view=diff&rev=10158&p1=branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-3.sql&p2=branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-3.sql&r1=10157&r2=10158
==============================================================================
--- branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-3.sql (original)
+++ branches/release/b21/src/sql/mysql/upgrade/mysql-upgrade-1.0b20-1.0b21-3.sql 2006-06-09 13:20:51-0700
@@ -1,40 +1,40 @@
-/*
- * b20-b21 Migration.
- *
- * SCB1565: Include 'last modified' and 'creation' information in search results
- * - Modifications on SCARAB_R_MODULE_USER_ATTRIBUTE
- * - Dump and recreate SCARAB_ISSUE with the new field (LAST_TRANS_ID) loaded
- *
- */
-
-/*
- * SCB1565: Creation and Last Modification date and users in Query Results
- *
- * - Add new column to SCARAB_R_MODULE_USER_ATTRIBUTE and modify the unique constraint
- *
- */
+--
+-- b20-b21 Migration.
+--
+-- SCB1565: Include 'last modified' and 'creation' information in search results
+-- - Modifications on SCARAB_R_MODULE_USER_ATTRIBUTE
+-- - Dump and recreate SCARAB_ISSUE with the new field (LAST_TRANS_ID) loaded
+--
+
+--
+-- SCB1565: Creation and Last Modification date and users in Query Results
+--
+-- - Add new column to SCARAB_R_MODULE_USER_ATTRIBUTE and modify the unique constraint
+--
ALTER TABLE SCARAB_R_MODULE_USER_ATTRIBUTE ADD (INTERNAL_ATTRIBUTE VARCHAR(20) NULL);
-/*
- * Drop index may fail, if it does not yet exist.
- * The related error message can safely be ignored.
- */
+--
+-- Drop index may fail, if it does not yet exist.
+-- The related error message can safely be ignored.
+--
DROP INDEX LIST_ID ON SCARAB_R_MODULE_USER_ATTRIBUTE;
CREATE UNIQUE INDEX LIST_ID ON SCARAB_R_MODULE_USER_ATTRIBUTE (LIST_ID,MODULE_ID,USER_ID,ISSUE_TYPE_ID,ATTRIBUTE_ID,INTERNAL_ATTRIBUTE);
-/*
- * Add new column to SCARAB_ISSUE with LAST_TRANS_ID, setting its value to
- * the older activity ID related to every issue
- *
- */
+--
+-- Add new column to SCARAB_ISSUE with LAST_TRANS_ID, setting its value to
+-- the older activity ID related to every issue
+--
+--
CREATE TABLE SCARAB_ISSUE_BACKUP_b20_b21
SELECT * FROM SCARAB_ISSUE;
DROP TABLE SCARAB_ISSUE;
+SET FOREIGN_KEY_CHECKS = 0;
+
CREATE TABLE SCARAB_ISSUE
(
PRIMARY KEY(ISSUE_ID),
@@ -46,9 +46,11 @@
INDEX IX_COUNT_PREFIX (ID_COUNT, ID_PREFIX)
)
SELECT i.ISSUE_ID, i.ID_PREFIX, i.ID_COUNT, i.ID_DOMAIN, i.TYPE_ID,
-i.MODULE_ID, i.CREATED_TRANS_ID,
-max(a.transaction_id) LAST_TRANS_ID, i.DELETED, i.MOVED
+ i.MODULE_ID, i.CREATED_TRANS_ID,
+ max(a.transaction_id) LAST_TRANS_ID,
+ i.DELETED, i.MOVED
FROM SCARAB_ISSUE_BACKUP_b20_b21 i LEFT OUTER JOIN SCARAB_ACTIVITY a ON
-(i.ISSUE_ID = a.ISSUE_ID)
+ (i.ISSUE_ID = a.ISSUE_ID)
GROUP BY i.ISSUE_ID;
+SET FOREIGN_KEY_CHECKS = 1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.