Merged migrations.

This commit is contained in:
Martin Edenhofer 2015-09-26 09:07:30 +02:00
parent bef4c843c8
commit 7aaceda8bd
4 changed files with 1 additions and 51 deletions

View file

@ -323,6 +323,7 @@ class CreateBase < ActiveRecord::Migration
t.string :state_current, limit: 2000, null: true
t.string :state_initial, limit: 2000, null: true
t.boolean :frontend, null: false
t.string :preferences, limit: 2000, null: true
t.timestamps
end
add_index :settings, [:name], unique: true

View file

@ -1,10 +0,0 @@
class UpdateSetting < ActiveRecord::Migration
def up
%w(product_name product_logo organization).each {|setting_name|
setting = Setting.find_by(name: setting_name)
next if !setting
setting.area = 'System::Branding'
setting.save
}
end
end

View file

@ -1,9 +0,0 @@
class UpdateSetting2 < ActiveRecord::Migration
def up
# add preferences
add_column :settings, :preferences, :string, limit: 2000, null: true
Setting.reset_column_information
end
end

View file

@ -1,32 +0,0 @@
class UpdateSetting3 < ActiveRecord::Migration
def up
# update settings
%w(product_name ticket_hook chat).each {|setting_name|
setting = Setting.find_by(name: setting_name)
next if !setting
setting.preferences[:render] = true
setting.save
}
%w(product_name).each {|setting_name|
setting = Setting.find_by(name: setting_name)
next if !setting
setting.preferences[:session_check] = true
setting.save
}
setting = Setting.find_by(name: 'product_name')
if setting
setting.preferences[:prio] = 1
setting.save
end
setting = Setting.find_by(name: 'organization')
if setting
setting.preferences[:prio] = 2
setting.save
end
setting = Setting.find_by(name: 'product_logo')
return if !setting
setting.preferences[:prio] = 3
setting.save
end
end