From 7aaceda8bd3f1525bda52fac6ac1fd97b8dee87a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 26 Sep 2015 09:07:30 +0200 Subject: [PATCH] Merged migrations. --- db/migrate/20120101000001_create_base.rb | 1 + db/migrate/20150712000001_update_setting.rb | 10 ------ db/migrate/20150712000002_update_setting2.rb | 9 ------ db/migrate/20150712000003_update_setting3.rb | 32 -------------------- 4 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 db/migrate/20150712000001_update_setting.rb delete mode 100644 db/migrate/20150712000002_update_setting2.rb delete mode 100644 db/migrate/20150712000003_update_setting3.rb diff --git a/db/migrate/20120101000001_create_base.rb b/db/migrate/20120101000001_create_base.rb index 677fc1e66..877618059 100644 --- a/db/migrate/20120101000001_create_base.rb +++ b/db/migrate/20120101000001_create_base.rb @@ -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 diff --git a/db/migrate/20150712000001_update_setting.rb b/db/migrate/20150712000001_update_setting.rb deleted file mode 100644 index fa9d50478..000000000 --- a/db/migrate/20150712000001_update_setting.rb +++ /dev/null @@ -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 diff --git a/db/migrate/20150712000002_update_setting2.rb b/db/migrate/20150712000002_update_setting2.rb deleted file mode 100644 index d2aca3055..000000000 --- a/db/migrate/20150712000002_update_setting2.rb +++ /dev/null @@ -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 diff --git a/db/migrate/20150712000003_update_setting3.rb b/db/migrate/20150712000003_update_setting3.rb deleted file mode 100644 index 685085dd1..000000000 --- a/db/migrate/20150712000003_update_setting3.rb +++ /dev/null @@ -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