rel-eng/packages/spacewalk-schema
| 2
schema/spacewalk/spacewalk-schema.spec
| 5 +-
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/026-rhnConfigRevision-triggers.sql.oracle
| 21 ++++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/026-rhnConfigRevision-triggers.sql.postgresql
| 21 ++++++++++
4 files changed, 47 insertions(+), 2 deletions(-)
New commits:
commit 5c70ab088f347a4aeaa19521c878a96b94a41dd5
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Jun 26 10:48:48 2013 +0200
Automatic commit of package [spacewalk-schema] release [1.10.51-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index 2c55452..89ec6b0 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.10.50-1 schema/spacewalk/
+1.10.51-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec
b/schema/spacewalk/spacewalk-schema.spec
index 16642e9..10b5362 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -4,7 +4,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.10.50
+Version: 1.10.51
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -71,6 +71,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-sql*
%changelog
+* Wed Jun 26 2013 Milan Zazrivec <mzazrivec(a)redhat.com> 1.10.51-1
+- schema upgrades for rhnConfigRevision triggers
+
* Tue Jun 25 2013 Grant Gainey 1.10.50-1
- ISS: mv sql-updates in prep for last(?) merge from master
- ISS: Mapping tables shouldn't have ID columns
commit 47395e42c7aedd5db0e83c965d103080b382a345
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Jun 26 10:48:11 2013 +0200
schema upgrades for rhnConfigRevision triggers
diff --git
a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/026-rhnConfigRevision-triggers.sql.oracle
b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/026-rhnConfigRevision-triggers.sql.oracle
new file mode 100644
index 0000000..eb6b5eb
--- /dev/null
+++
b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/026-rhnConfigRevision-triggers.sql.oracle
@@ -0,0 +1,21 @@
+create or replace trigger
+rhn_confrevision_del_trig
+before delete on rhnConfigRevision
+for each row
+declare
+ cr_removed number := lookup_snapshot_invalid_reason('cr_removed');
+begin
+ update rhnSnapshot
+ set invalid = cr_removed
+ where id in (select snapshot_id
+ from rhnSnapshotConfigRevision
+ where config_revision_id = :old.id);
+ delete from rhnSnapshotConfigRevision
+ where config_revision_id = :old.id
+ and snapshot_id in (select snapshot_id
+ from rhnSnapshotConfigRevision
+ where config_revision_id = :old.id);
+ end loop;
+end;
+/
+show errors
diff --git
a/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/026-rhnConfigRevision-triggers.sql.postgresql
b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/026-rhnConfigRevision-triggers.sql.postgresql
new file mode 100644
index 0000000..f075070
--- /dev/null
+++
b/schema/spacewalk/upgrade/spacewalk-schema-1.9-to-spacewalk-schema-1.10/026-rhnConfigRevision-triggers.sql.postgresql
@@ -0,0 +1,21 @@
+-- oracle equivalent source sha1 929649a1abb7046d77f1ca93f1f33401b180c6d6
+
+create or replace function rhn_confrevision_del_trig_fun() returns trigger
+as
+$$
+declare
+ cr_removed numeric := lookup_snapshot_invalid_reason('cr_removed');
+begin
+ update rhnSnapshot
+ set invalid = cr_removed
+ where id in (select snapshot_id
+ from rhnSnapshotConfigRevision
+ where config_revision_id = old.id);
+ delete from rhnSnapshotConfigRevision
+ where config_revision_id = old.id
+ and snapshot_id in (select snapshot_id
+ from rhnSnapshotConfigRevision
+ where config_revision_id = old.id);
+ return old;
+end;
+$$ language plpgsql;
Show replies by thread