]> source.dussan.org Git - sonarqube.git/commitdiff
revert SONAR-1988 - requires to upgrade to activerecord-jdbc-adapter 0.9.2
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 24 Nov 2010 10:39:42 +0000 (10:39 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 24 Nov 2010 10:39:42 +0000 (10:39 +0000)
sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
sonar-server/src/main/webapp/WEB-INF/config/environment.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/160_nullable_rule_parameter_description.rb [deleted file]

index 1b9b642960d423debe67468f2db2249ce40fe181..5a6ec38be20be8c8364ba5fd610b61ad3f946e91 100644 (file)
@@ -30,7 +30,7 @@ import java.sql.Statement;
 public class SchemaMigration {
 
   public final static int VERSION_UNKNOWN = -1;
-  public static final int LAST_VERSION = 160
+  public static final int LAST_VERSION = 152
 
   public final static String TABLE_NAME = "schema_migrations";
 
index 8c1197f98f28b85ae81703000cb64d21a1a524e7..1f4acf43ec26b12497c790567d935223fa116ecb 100644 (file)
@@ -135,16 +135,6 @@ module JdbcSpec
 
       tp
     end
-
-    def change_column_null(table_name, column_name, null, default = nil)
-      column = column_for(table_name, column_name)
-
-      unless null || default.nil?
-        execute("UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(column_name)}=#{quote(default)} WHERE #{quote_column_name(column_name)} IS NULL")
-      end
-
-      change_column table_name, column_name, column.sql_type, :null => null
-    end
   end
   
   # wrong column types on oracle 10g timestamp and datetimes
@@ -197,15 +187,6 @@ module JdbcSpec
     def quote_table_name(name) #:nodoc:
       quote_column_name(name).gsub('.', '`.`')
     end
-
-
-    # see http://jira.codehaus.org/browse/JRUBY-4719
-    def change_column_null(table_name, column_name, null, default = nil)
-      unless null || default.nil?
-        execute("UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(column_name)}=#{quote(default)} WHERE #{quote_column_name(column_name)} IS NULL")
-      end
-      execute("ALTER TABLE #{quote_table_name(table_name)} ALTER COLUMN #{quote_column_name(column_name)} #{'NOT ' unless null}NULL")
-    end
   end
 
   module PostgreSQL
@@ -234,15 +215,6 @@ module JdbcSpec
       end
       @connection.columns_internal(table_name, name, schema_name)
     end
-
-
-    # see http://jira.codehaus.org/browse/JRUBY-3608
-    def change_column_null(table_name, column_name, null, default = nil)
-      unless null || default.nil?
-        execute("UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(column_name)}=#{quote(default)} WHERE #{quote_column_name(column_name)} IS NULL")
-      end
-      execute("ALTER TABLE #{quote_table_name(table_name)} ALTER #{quote_column_name(column_name)} #{null ? 'DROP' : 'SET'} NOT NULL")
-    end
   end
 end
 
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/160_nullable_rule_parameter_description.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/160_nullable_rule_parameter_description.rb
deleted file mode 100644 (file)
index 2b9fcde..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Sonar, open source software quality management tool.
-# Copyright (C) 2009 SonarSource SA
-# mailto:contact AT sonarsource DOT com
-#
-# Sonar is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# Sonar is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with Sonar; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
-#
-class NullableRuleParameterDescription < ActiveRecord::Migration
-
-  def self.up
-    change_column_null(:rules_parameters, :description, true)
-  end
-end
\ No newline at end of file