schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/125-alter-index-rhnRam.sql
| 14 +++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
New commits:
commit a8f5e789e3b7ce443d760ad06beb7393a7087363
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Thu May 23 15:54:18 2013 +0200
Don't drop rhn_ram_sid_idx if it does not exist.
diff --git
a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/125-alter-index-rhnRam.sql
b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/125-alter-index-rhnRam.sql
index d5a9502..9d8104f 100644
---
a/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/125-alter-index-rhnRam.sql
+++
b/schema/spacewalk/upgrade/spacewalk-schema-1.5-to-spacewalk-schema-1.6/125-alter-index-rhnRam.sql
@@ -2,7 +2,19 @@ delete from rhnram X
where server_id in (select server_id from rhnram group by server_id having
count(server_id)>1)
and id<(select max(id) from rhnram Y where X.server_id=Y.server_id group by
server_id having count(server_id)>1);
-DROP INDEX rhn_ram_sid_idx;
+set serverout on;
+
+declare
+ non_existent_index exception;
+ pragma exception_init(non_existent_index, -01418);
+begin
+ execute immediate 'drop index rhn_ram_sid_idx';
+ dbms_output.put_line('Index rhn_ram_sid_idx successfully dropped.');
+exception
+ when non_existent_index then
+ null;
+end;
+/
CREATE UNIQUE INDEX rhn_ram_sid_uq
ON rhnRam (server_id)
Show replies by date