aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-09-07 12:03:31 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-09-07 12:03:38 +0200
commit081adad23e053449b2f187c2e74d481bb1b25feb (patch)
tree0899a8dddb15c334e422d6a08d26c452e5591195
parent633d579416a0c44bc3ed32d27dc68e8422346ce7 (diff)
downloadsonarqube-081adad23e053449b2f187c2e74d481bb1b25feb.tar.gz
sonarqube-081adad23e053449b2f187c2e74d481bb1b25feb.zip
SONAR-2549 do not use the Oracle type 'DATE' for ActiveRecord type :datetime
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_schema_statements.rb9
2 files changed, 11 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb b/sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
index 22c94d6611f..0bed8625b49 100644
--- a/sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb
@@ -295,7 +295,9 @@ module ActiveRecord
:integer => { :name => "NUMBER", :limit => 38 },
:float => { :name => "NUMBER" },
:decimal => { :name => "DECIMAL" },
- :datetime => { :name => "DATE" },
+ # sonar
+ :datetime => { :name => "TIMESTAMP" },
+ # /sonar
# changed to native TIMESTAMP type
# :timestamp => { :name => "DATE" },
:timestamp => { :name => "TIMESTAMP" },
diff --git a/sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_schema_statements.rb b/sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_schema_statements.rb
index ca9040f7029..86e24d04859 100644
--- a/sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_schema_statements.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/vendor/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_schema_statements.rb
@@ -113,7 +113,9 @@ module ActiveRecord
# clear cached indexes when adding new index
def add_index(table_name, column_name, options = {}) #:nodoc:
column_names = Array(column_name)
- index_name = index_name(table_name, :column => column_names)
+ # sonar - see below
+ index_name = nil
+ # /sonar
if Hash === options # legacy support, since this param was a string
index_type = options[:unique] ? "UNIQUE" : ""
@@ -122,6 +124,11 @@ module ActiveRecord
else
index_type = options
end
+
+ # sonar - move the call to index_name() in order to remove the log "Oracle enhanced shortened index name" even if the index name
+ # is explicitly set by migrations with the :name option
+ index_name = index_name(table_name, :column => column_names) unless index_name
+ # /sonar
if index_name.to_s.length > index_name_length
raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' is too long; the limit is #{index_name_length} characters"