Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18232 e93f8b46-1217-0410-a6f0-8f06a7374b81tags/4.1.0
class SaltUserPasswords < ActiveRecord::Migration[4.2] | class SaltUserPasswords < ActiveRecord::Migration[4.2] | ||||
def self.up | def self.up | ||||
say_with_time "Salting user passwords, this may take some time..." do | say_with_time "Salting user passwords, this may take some time..." do | ||||
User.salt_unsalted_passwords! | User.salt_unsalted_passwords! |
# Just in case | # Just in case | ||||
duplicates = Token.connection.select_values("SELECT value FROM #{Token.table_name} GROUP BY value HAVING COUNT(id) > 1") | duplicates = Token.connection.select_values("SELECT value FROM #{Token.table_name} GROUP BY value HAVING COUNT(id) > 1") | ||||
Token.where(:value => duplicates).delete_all | Token.where(:value => duplicates).delete_all | ||||
add_index :tokens, :value, :unique => true, :name => 'tokens_value' | add_index :tokens, :value, :unique => true, :name => 'tokens_value' | ||||
end | end | ||||
end | end |
class ChangeAttachmentsFilesizeLimitTo8 < ActiveRecord::Migration[4.2] | class ChangeAttachmentsFilesizeLimitTo8 < ActiveRecord::Migration[4.2] | ||||
def self.up | |||||
def self.up | |||||
change_column :attachments, :filesize, :integer, :limit => 8, :default => 0, :null => false | change_column :attachments, :filesize, :integer, :limit => 8, :default => 0, :null => false | ||||
end | end | ||||
class FixCommaInUserFormatSettingValue < ActiveRecord::Migration[4.2] | class FixCommaInUserFormatSettingValue < ActiveRecord::Migration[4.2] | ||||
def self.up | |||||
def self.up | |||||
Setting. | Setting. | ||||
where(:name => 'user_format', :value => 'lastname_coma_firstname'). | where(:name => 'user_format', :value => 'lastname_coma_firstname'). | ||||
update_all(:value => 'lastname_comma_firstname') | update_all(:value => 'lastname_comma_firstname') |
class ChangeIssueCategoriesNameLimitTo60 < ActiveRecord::Migration[4.2] | class ChangeIssueCategoriesNameLimitTo60 < ActiveRecord::Migration[4.2] | ||||
def self.up | |||||
def self.up | |||||
change_column :issue_categories, :name, :string, :limit => 60, :default => "", :null => false | change_column :issue_categories, :name, :string, :limit => 60, :default => "", :null => false | ||||
end | end | ||||
class ChangeAuthSourcesFilterToText < ActiveRecord::Migration[4.2] | class ChangeAuthSourcesFilterToText < ActiveRecord::Migration[4.2] | ||||
def self.up | |||||
def self.up | |||||
change_column :auth_sources, :filter, :text | change_column :auth_sources, :filter, :text | ||||
end | end | ||||