diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-28 20:27:04 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-28 20:27:04 +0100 |
commit | f3c3e77eaa2b82567f02601b6f66177208674181 (patch) | |
tree | 1946390f7f697e80fcdab4164ad620d507b6a1fe /db/migrate | |
parent | 3e76142566ad8f55a64a88fe5c19e7d0ec7c11c0 (diff) | |
parent | 8d20201910b1915cffa495e6474d50f9c8e8331d (diff) |
Merge branch 'develop'5.0.1
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20121223110948_add_tenant_to_phone.rb | 6 | ||||
-rw-r--r-- | db/migrate/20121223111155_add_fallback_sip_account_to_phone.rb | 6 | ||||
-rw-r--r-- | db/migrate/20121228101454_update_tenant_id.rb | 16 |
3 files changed, 28 insertions, 0 deletions
diff --git a/db/migrate/20121223110948_add_tenant_to_phone.rb b/db/migrate/20121223110948_add_tenant_to_phone.rb new file mode 100644 index 0000000..dbe0412 --- /dev/null +++ b/db/migrate/20121223110948_add_tenant_to_phone.rb @@ -0,0 +1,6 @@ +class AddTenantToPhone < ActiveRecord::Migration + def change + add_column :phones, :tenant_id, :integer + + end +end diff --git a/db/migrate/20121223111155_add_fallback_sip_account_to_phone.rb b/db/migrate/20121223111155_add_fallback_sip_account_to_phone.rb new file mode 100644 index 0000000..94a8050 --- /dev/null +++ b/db/migrate/20121223111155_add_fallback_sip_account_to_phone.rb @@ -0,0 +1,6 @@ +class AddFallbackSipAccountToPhone < ActiveRecord::Migration + def change + add_column :phones, :fallback_sip_account_id, :integer + + end +end diff --git a/db/migrate/20121228101454_update_tenant_id.rb b/db/migrate/20121228101454_update_tenant_id.rb new file mode 100644 index 0000000..dc2f37c --- /dev/null +++ b/db/migrate/20121228101454_update_tenant_id.rb @@ -0,0 +1,16 @@ +class UpdateTenantId < ActiveRecord::Migration + def up + Phone.all.each do |phone| + phone.tenant_id = Tenant.last.id + phone.save + end + + Phone.where(:hot_deskable => true).each do |phone| + phone.fallback_sip_account = phone.sip_accounts.where(:sip_accountable_type => 'Tenant').first + phone.save + end + end + + def down + end +end |