From fdddef2258dce0c2be29f7ac62c7b20eb192dcbb Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Wed, 7 Sep 2016 15:34:14 +0200 Subject: [PATCH] SONAR-7676 rename_table must drop and create Oracle triggers --- .../sonar-web/src/main/webapp/WEB-INF/config/environment.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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}", -- 2.39.5