Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Commit

rt branch, 4.0/apply-scrips-to-multiple-queues, updated. rt-4.0.4-216-g9305b1a

 

 

Request Tracker commit RSS feed   Index | Next | Previous | View Threaded


ruz at bestpractical

May 2, 2012, 3:51 AM

Post #1 of 1 (139 views)
Permalink
rt branch, 4.0/apply-scrips-to-multiple-queues, updated. rt-4.0.4-216-g9305b1a

The branch, 4.0/apply-scrips-to-multiple-queues has been updated
via 9305b1a054381cfd6c2c15417a404a6e56cc01d9 (commit)
via 65641b024f8aef6b78fd0d94f44e6526af150e65 (commit)
from 9245229a480ef28c2bf093f08c9b97e53825143b (commit)

Summary of changes:
etc/upgrade/4.1.0/schema.Oracle | 38 +++++++++++++++++++++
etc/upgrade/4.1.0/{schema.mysql => schema.SQLite} | 15 ++++----
2 files changed, 46 insertions(+), 7 deletions(-)
create mode 100644 etc/upgrade/4.1.0/schema.Oracle
copy etc/upgrade/4.1.0/{schema.mysql => schema.SQLite} (75%)

- Log -----------------------------------------------------------------
commit 65641b024f8aef6b78fd0d94f44e6526af150e65
Author: Ruslan Zakirov <ruz [at] bestpractical>
Date: Fri Apr 13 20:06:53 2012 +0400

schema upgrade for Oracle

diff --git a/etc/upgrade/4.1.0/schema.Oracle b/etc/upgrade/4.1.0/schema.Oracle
new file mode 100644
index 0000000..097adbf
--- /dev/null
+++ b/etc/upgrade/4.1.0/schema.Oracle
@@ -0,0 +1,38 @@
+CREATE SEQUENCE OBJECTSCRIPS_seq;
+CREATE TABLE ObjectScrips (
+ id NUMBER(11,0)
+ CONSTRAINT ObjectScrips_Key PRIMARY KEY,
+ Scrip NUMBER(11,0) NOT NULL,
+ Stage VARCHAR2(32) DEFAULT 'TransactionCreate' NOT NULL,
+ ObjectId NUMBER(11,0) NOT NULL,
+ SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL,
+ Disabled NUMBER(11,0) DEFAULT 0 NOT NULL,
+ Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
+ Created DATE,
+ LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
+ LastUpdated DATE
+);
+
+INSERT INTO ObjectScrips(
+ id, Scrip, Stage, ObjectId,
+ Creator, Created, LastUpdatedBy, LastUpdated
+)
+(SELECT OBJECTSCRIPS_seq.nextval, id, Stage, Queue, Creator, Created, LastUpdatedBy, LastUpdated
+FROM Scrips)
+;
+
+UPDATE ObjectScrips SET Disabled = 1 WHERE Scrip IN (
+ SELECT id FROM Scrips WHERE Stage = 'Disabled'
+);
+UPDATE ObjectScrips SET Stage = 'TransactionCreate' WHERE Stage = 'Disabled';
+
+CREATE UNIQUE INDEX ObjectScrips1 ON ObjectScrips (ObjectId, Scrip);
+
+ALTER TABLE Scrips DROP COLUMN Stage;
+ALTER TABLE Scrips DROP COLUMN Queue;
+
+ALTER TABLE ObjectCustomFields ADD COLUMN Disabled int2 NOT NULL DEFAULT 0;
+UPDATE ObjectCustomFields SET Disabled = 1 WHERE CustomField IN (
+ SELECT id FROM CustomFields WHERE Disabled != 0
+);
+ALTER TABLE CustomFields DROP COLUMN Disabled;
\ No newline at end of file

commit 9305b1a054381cfd6c2c15417a404a6e56cc01d9
Author: Ruslan Zakirov <ruz [at] bestpractical>
Date: Fri Apr 13 20:07:08 2012 +0400

incomplete schema upgrade for SQLite

drop column is special

diff --git a/etc/upgrade/4.1.0/schema.SQLite b/etc/upgrade/4.1.0/schema.SQLite
new file mode 100644
index 0000000..15df601
--- /dev/null
+++ b/etc/upgrade/4.1.0/schema.SQLite
@@ -0,0 +1,39 @@
+
+CREATE TABLE ObjectScrips (
+ id INTEGER NOT NULL ,
+ Scrip int NOT NULL ,
+ Stage varchar(32) NOT NULL DEFAULT 'TransactionCreate' ,
+ ObjectId integer NOT NULL,
+ SortOrder integer NOT NULL DEFAULT 0 ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
+
+ Creator integer NOT NULL DEFAULT 0 ,
+ Created DATETIME NULL ,
+ LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdated DATETIME NULL ,
+ PRIMARY KEY (id)
+);
+
+INSERT INTO ObjectScrips(
+ Scrip, Stage, ObjectId,
+ Creator, Created, LastUpdatedBy, LastUpdated
+)
+SELECT id, Stage, Queue, Creator, Created, LastUpdatedBy, LastUpdated
+FROM Scrips
+;
+
+UPDATE ObjectScrips SET Disabled = 1 WHERE Scrip IN (
+ SELECT id FROM Scrips WHERE Stage = 'Disabled'
+);
+UPDATE ObjectScrips SET Stage = 'TransactionCreate' WHERE Stage = 'Disabled';
+
+CREATE UNIQUE INDEX ObjectScrips1 ON ObjectScrips (ObjectId, Scrip);
+
+# TODO: ALTER TABLE Scrips DROP COLUMN Stage;
+# TODO: ALTER TABLE Scrips DROP COLUMN Queue;
+
+ALTER TABLE ObjectCustomFields ADD COLUMN Disabled int2 NOT NULL DEFAULT 0;
+UPDATE ObjectCustomFields SET Disabled = 1 WHERE CustomField IN (
+ SELECT id FROM CustomFields WHERE Disabled != 0
+);
+# TODO: ALTER TABLE CustomFields DROP COLUMN Disabled;
\ No newline at end of file

-----------------------------------------------------------------------
_______________________________________________
Rt-commit mailing list
Rt-commit [at] lists
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit

Request Tracker commit RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.