r5412 - trunk/cumin/model/upgrades

tmckay at fedoraproject.org tmckay at fedoraproject.org
Wed Jun 13 19:38:29 UTC 2012


Author: tmckay
Date: 2012-06-13 19:38:27 +0000 (Wed, 13 Jun 2012)
New Revision: 5412

Modified:
   trunk/cumin/model/upgrades/1.2_to_1.3
Log:
Change of schema from 1.2 to 1.3 include moving of the BrokerGroup and BrokerGroupMapping tables from com.redhat.cumin to com.redhat.cumin.messaging.


Modified: trunk/cumin/model/upgrades/1.2_to_1.3
===================================================================
--- trunk/cumin/model/upgrades/1.2_to_1.3	2012-06-13 00:39:48 UTC (rev 5411)
+++ trunk/cumin/model/upgrades/1.2_to_1.3	2012-06-13 19:38:27 UTC (rev 5412)
@@ -19,4 +19,51 @@
 echo 'ALTER TABLE "com.redhat.grid.plumage"."OSUtil_samples" ADD COLUMN usedcpu int8 NOT NULL DEFAULT 0' | psql -d cumin -U cumin -h localhost
 echo 'ALTER TABLE "com.redhat.grid.plumage"."OSUtil_samples" ADD COLUMN availcpu int8 NOT NULL DEFAULT 0' | psql -d cumin -U cumin -h localhost
 echo 'ALTER TABLE "com.redhat.grid.plumage"."OSUtil_samples" ADD COLUMN totalcpu int8 NOT NULL DEFAULT 0' | psql -d cumin -U cumin -h localhost
-
+echo 'DROP TABLE "com.redhat.cumin"."BrokerGroup" cascade' | psql -d cumin -U cumin -h localhost
+echo 'DROP TABLE "com.redhat.cumin"."BrokerGroup_samples" cascade' | psql -d cumin -U cumin -h localhost
+echo 'DROP TABLE "com.redhat.cumin"."BrokerGroupMapping" cascade' | psql -d cumin -U cumin -h localhost
+echo 'DROP TABLE "com.redhat.cumin"."BrokerGroupMapping_samples" cascade' | psql -d cumin -U cumin -h localhost
+echo 'DROP SEQUENCE "com.redhat.cumin"."BrokerGroup_id_seq"' | psql -d cumin -U cumin -h localhost
+echo 'DROP SEQUENCE "com.redhat.cumin"."BrokerGroupMapping_id_seq"' | psql -d cumin -U cumin -h localhost
+echo 'create schema "com.redhat.cumin.messaging"' | psql -d cumin -U cumin -h localhost
+echo 'create sequence "com.redhat.cumin.messaging"."BrokerGroup_id_seq"'| psql -d cumin -U cumin -h localhost
+echo 'create sequence "com.redhat.cumin.messaging"."BrokerGroupMapping_id_seq"'| psql -d cumin -U cumin -h localhost
+echo 'create table "com.redhat.cumin.messaging"."BrokerGroup" (
+        "_id" int8 not null,
+        "_qmf_agent_id" text not null,
+        "_qmf_object_id" text not null,
+        "_qmf_create_time" timestamp not null,
+        "_qmf_update_time" timestamp not null,
+        "_qmf_delete_time" timestamp,
+        "name" text not null,
+        "description" text,
+        constraint "BrokerGroup_pk" primary key ("_id"),
+        constraint "BrokerGroup_qmf_id_uq" unique ("_qmf_agent_id", "_qmf_object_id")
+        )' | psql -d cumin -U cumin -h localhost
+echo 'create table "com.redhat.cumin.messaging"."BrokerGroup_samples" (
+        "_qmf_agent_id" text not null,
+        "_qmf_object_id" text not null,
+        "_qmf_update_time" timestamp not null
+        )' | psql -d cumin -U cumin -h localhost
+echo 'create table "com.redhat.cumin.messaging"."BrokerGroupMapping" (
+        "_id" int8 not null,
+        "_qmf_agent_id" text not null,
+        "_qmf_object_id" text not null,
+        "_qmf_create_time" timestamp not null,
+        "_qmf_update_time" timestamp not null,
+        "_qmf_delete_time" timestamp,
+        "_broker_id" int8,
+        "_group_id" int8,
+        constraint "BrokerGroupMapping_pk" primary key ("_id"),
+        constraint "BrokerGroupMapping_qmf_id_uq" unique ("_qmf_agent_id", "_qmf_object_id")
+        )' | psql -d cumin -U cumin -h localhost
+echo 'create table "com.redhat.cumin.messaging"."BrokerGroupMapping_samples" (
+        "_qmf_agent_id" text not null,
+        "_qmf_object_id" text not null,
+        "_qmf_update_time" timestamp not null
+        )' | psql -d cumin -U cumin -h localhost
+echo 'create index "BrokerGroup_samples_qmf_id_idx" on "com.redhat.cumin.messaging"."BrokerGroup_samples" ("_qmf_agent_id", "_qmf_object_id")' | psql -d cumin -U cumin -h localhost
+echo 'create index "BrokerGroupMapping_samples_qmf_id_idx" on "com.redhat.cumin.messaging"."BrokerGroupMapping_samples" ("_qmf_agent_id", "_qmf_object_id")' | psql -d cumin -U cumin -h localhost
+echo 'alter table "com.redhat.cumin.messaging"."BrokerGroupMapping"
+    add constraint "_broker_id_fk" foreign key ("_broker_id") references "org.apache.qpid.broker"."Broker" ("_id") on update cascade on delete set null,
+    add constraint "_group_id_fk" foreign key ("_group_id") references "com.redhat.cumin.messaging"."BrokerGroup" ("_id") on update cascade on delete set null' | psql -d cumin -U cumin -h localhost



More information about the cumin-developers mailing list