From: Sébastien Lesaint Date: Wed, 7 Sep 2016 13:34:14 +0000 (+0200) Subject: SONAR-7676 rename_table must drop and create Oracle triggers X-Git-Tag: 6.1-RC1~173 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fdddef2258dce0c2be29f7ac62c7b20eb192dcbb;p=sonarqube.git SONAR-7676 rename_table must drop and create Oracle triggers --- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/config/environment.rb b/server/sonar-web/src/main/webapp/WEB-INF/config/environment.rb index 2c11674da95..c074b06be76 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/config/environment.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/config/environment.rb @@ -242,6 +242,12 @@ class ActiveRecord::Migration drop_id_trigger(table_name) if dialect()=='oracle' end + def self.rename_table(old_table_name, new_table_name, options = {}) + drop_id_trigger(old_table_name) if dialect()=='oracle' && options[:id] != false + super(old_table_name, new_table_name) + create_id_trigger(new_table_name) if dialect()=='oracle' && options[:id] != false + end + def self.create_id_trigger(table) execute_ddl("create trigger for table #{table}",