From c769d5e095106fe0e922255d192c562ffef2f918 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 29 Sep 2015 22:48:57 +0200 Subject: [PATCH] SONAR-6883 Fail to create MySQL table --- .../webapp/WEB-INF/db/migrate/540_create_activities_table.rb | 2 +- .../connection_adapters/abstract/schema_statements.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/540_create_activities_table.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/540_create_activities_table.rb index 9402c05c765..df22c5c638d 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/540_create_activities_table.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/540_create_activities_table.rb @@ -31,7 +31,7 @@ class CreateActivitiesTable < ActiveRecord::Migration t.column 'log_type', :string, :limit => 50 t.column 'log_action', :string, :limit => 50 t.column 'log_message', :string, :limit => 4000 - t.column 'log_key', :string + t.column 'log_key', :string, :limit => 250 end add_index 'activities', :log_key, :name => 'activities_log_key', :unique => true end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb index 12826b195fd..631c30c9af3 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -369,7 +369,8 @@ module ActiveRecord unless tables.detect { |t| t == sm_table } create_table(sm_table, :id => false) do |schema_migrations_table| - schema_migrations_table.column :version, :string, :null => false + # sonar: add missing :limit => 255 to not break mysql on some windows environments + schema_migrations_table.column :version, :string, :null => false, :limit => 255 end add_index sm_table, :version, :unique => true, :name => "#{Base.table_name_prefix}unique_schema_migrations#{Base.table_name_suffix}" -- 2.39.5