summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-28 12:08:03 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-28 12:08:03 +0100
commita6d6c880f909af56e345eff1bd33db4c4b76b63d (patch)
tree8b1f7e75e1e704f3f5b5deaa9b5082d7276891ce
parent43199a00bcb0cc93775a3e3b71abea476a33a1a7 (diff)
Updates some needed attributes of old installations. closes #32
-rw-r--r--db/migrate/20121228101454_update_tenant_id.rb12
-rw-r--r--db/schema.rb4
2 files changed, 15 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..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
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|