summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-28 12:58:28 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-28 12:58:28 +0100
commitb2e5168b917202ebd71f3032f125691ef1fd062f (patch)
tree6dfcabddcae1583788797dec4650fb2eb93c3b58 /db/migrate
parent25d5c729e37f39799c415dfedf7b1699c328d02f (diff)
parent9190c997fe17ed1c680d2b073c8d2e21ac864b57 (diff)
Merge branch 'bugfix' into develop
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20121228101454_update_tenant_id.rb16
1 files changed, 16 insertions, 0 deletions
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