diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-28 12:58:28 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2012-12-28 12:58:28 +0100 |
commit | b2e5168b917202ebd71f3032f125691ef1fd062f (patch) | |
tree | 6dfcabddcae1583788797dec4650fb2eb93c3b58 | |
parent | 25d5c729e37f39799c415dfedf7b1699c328d02f (diff) | |
parent | 9190c997fe17ed1c680d2b073c8d2e21ac864b57 (diff) |
Merge branch 'bugfix' into develop
-rw-r--r-- | db/migrate/20121228101454_update_tenant_id.rb | 16 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 19 insertions, 1 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 diff --git a/db/schema.rb b/db/schema.rb index 1395e1b..804ff5f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20121125084447) do +ActiveRecord::Schema.define(:version => 20121228101454) do create_table "access_authorizations", :force => true do |t| t.string "access_authorizationable_type" @@ -738,6 +738,8 @@ ActiveRecord::Schema.define(:version => 20121125084447) do t.boolean "nightly_reboot" t.string "provisioning_key" t.boolean "provisioning_key_active" + t.integer "tenant_id" + t.integer "fallback_sip_account_id" end create_table "registrations", :id => false, :force => true do |t| |