From 9101b20cc5ca4e0553cfb4a503f0d2d51863ba37 Mon Sep 17 00:00:00 2001 From: spag Date: Sun, 23 Dec 2012 15:01:41 +0000 Subject: tennant added --- db/migrate/20121223110948_add_tenant_to_phone.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrate/20121223110948_add_tenant_to_phone.rb (limited to 'db/migrate') 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 -- cgit v1.2.3 From f425280a6312638f364f6ae8d915a30d78a8dce4 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Sun, 23 Dec 2012 15:02:30 +0000 Subject: fallback_sip_account added --- db/migrate/20121223111155_add_fallback_sip_account_to_phone.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrate/20121223111155_add_fallback_sip_account_to_phone.rb (limited to 'db/migrate') 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 -- cgit v1.2.3 From a6d6c880f909af56e345eff1bd33db4c4b76b63d Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 28 Dec 2012 12:08:03 +0100 Subject: Updates some needed attributes of old installations. closes #32 --- db/migrate/20121228101454_update_tenant_id.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 db/migrate/20121228101454_update_tenant_id.rb (limited to 'db/migrate') diff --git a/db/migrate/20121228101454_update_tenant_id.rb b/db/migrate/20121228101454_update_tenant_id.rb new file mode 100644 index 0000000..5c46b04 --- /dev/null +++ b/db/migrate/20121228101454_update_tenant_id.rb @@ -0,0 +1,12 @@ +class UpdateTenantId < ActiveRecord::Migration + def up + Phone.where(:hot_deskable => true).each do |phone| + phone.tenant_id = Tenant.last.id + phone.fallback_sip_account = phone.sip_accounts.where(:sip_accountable_type => 'Tenant').first + phone.save + end + end + + def down + end +end -- cgit v1.2.3 From 9190c997fe17ed1c680d2b073c8d2e21ac864b57 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 28 Dec 2012 12:57:24 +0100 Subject: Update some Phone attributes. Which where introduced with 9101b20cc5ca4e0553cfb4a503f0d2d51863ba37 --- db/migrate/20121228101454_update_tenant_id.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'db/migrate') diff --git a/db/migrate/20121228101454_update_tenant_id.rb b/db/migrate/20121228101454_update_tenant_id.rb index 5c46b04..dc2f37c 100644 --- a/db/migrate/20121228101454_update_tenant_id.rb +++ b/db/migrate/20121228101454_update_tenant_id.rb @@ -1,7 +1,11 @@ class UpdateTenantId < ActiveRecord::Migration def up - Phone.where(:hot_deskable => true).each do |phone| + 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 -- cgit v1.2.3