Skip to content
Extraits de code Groupes Projets
Valider 3a8724bf rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

Merge branch 'release/0.5.0.0-RC' into develop

parents 85c376e5 fa7a7c5d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -177,6 +177,7 @@ diaspora* no longer adds a `div.container` to wrap custom splash pages. This add ...@@ -177,6 +177,7 @@ diaspora* no longer adds a `div.container` to wrap custom splash pages. This add
* Prevent inserting posts into the wrong stream [#5838](https://github.com/diaspora/diaspora/pull/5838) * Prevent inserting posts into the wrong stream [#5838](https://github.com/diaspora/diaspora/pull/5838)
* Update help section [#5857](https://github.com/diaspora/diaspora/pull/5857) [#5859](https://github.com/diaspora/diaspora/pull/5859) * Update help section [#5857](https://github.com/diaspora/diaspora/pull/5857) [#5859](https://github.com/diaspora/diaspora/pull/5859)
* Fix asset precompilation check in script/server [#5863](https://github.com/diaspora/diaspora/pull/5863) * Fix asset precompilation check in script/server [#5863](https://github.com/diaspora/diaspora/pull/5863)
* Convert MySQL databases to utf8mb4 [#5530](https://github.com/diaspora/diaspora/pull/5530) [#5624](https://github.com/diaspora/diaspora/pull/5624) [#5865](https://github.com/diaspora/diaspora/pull/5865)
## Features ## Features
* Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105) * Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105)
......
...@@ -25,24 +25,13 @@ class SetMysqlToUnicodeMb4 < ActiveRecord::Migration ...@@ -25,24 +25,13 @@ class SetMysqlToUnicodeMb4 < ActiveRecord::Migration
execute "ALTER DATABASE `#{ActiveRecord::Base.connection.current_database}` CHARACTER SET #{encoding} COLLATE #{collation};" execute "ALTER DATABASE `#{ActiveRecord::Base.connection.current_database}` CHARACTER SET #{encoding} COLLATE #{collation};"
tables.each do |table| tables.each do |table|
execute "ALTER TABLE `#{table}` CHARACTER SET = #{encoding} COLLATE #{collation}"
end
character_columns.each do |table, columns| modify_text_columns = columns(table).select {|column| column.type == :text }.map {|column|
columns.each do |column| "MODIFY `#{column.name}` TEXT #{'NOT' unless column.null } NULL#{" DEFAULT '#{column.default}'" if column.has_default?}"
execute "ALTER TABLE `#{table}` CHANGE `#{column.name}` `#{column.name}` #{column.sql_type} CHARACTER SET #{encoding} COLLATE #{collation} #{column.null ? 'NULL' : 'NOT NULL'} #{"DEFAULT '#{column.default}'" if column.has_default?};" }.join(", ")
end
end
end
def character_columns execute "ALTER TABLE `#{table}` CONVERT TO CHARACTER SET #{encoding} COLLATE #{collation}#{", #{modify_text_columns}" unless modify_text_columns.empty?};"
# build a hash with all the columns that contain characters end
@character_columns ||= Hash[tables.map {|table|
col = columns(table)
.select {|column| column.type == :string || column.type == :text }
next if col.empty?
[table, col]
}.compact]
end end
def shorten_indexes def shorten_indexes
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter