summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20120119154952_area_codes_germany.rb4
-rw-r--r--db/migrate/20130224091700_add_initial_groups.rb1
-rw-r--r--db/migrate/20130322081621_create_voicemail_accounts.rb17
-rw-r--r--db/migrate/20130322102533_add_voicemail_account_id_to_sip_accounts.rb5
-rw-r--r--db/migrate/20130326064557_create_voicemail_settings.rb16
-rw-r--r--db/migrate/20130403200754_add_reload_timer_to_switchboard.rb7
-rw-r--r--db/migrate/20130404094648_add_amount_of_displayed_phone_numbers_to_switchboard.rb17
-rw-r--r--db/migrate/20130410123523_create_generic_files.rb17
-rw-r--r--db/migrate/20130411151900_add_presence_permission_to_groups.rb11
-rw-r--r--db/migrate/20130506093400_add_idle_text_gs_parameters.rb9
-rw-r--r--db/migrate/20130507095000_add_display_id_unicode_gs_parameters.rb9
-rw-r--r--db/migrate/20130524140600_add_switchable_to_switchboard_entry.rb5
-rw-r--r--db/migrate/20130530123600_add_perimeter_report_url.rb9
-rw-r--r--db/migrate/20130531063549_create_geo_ip_countries.rb15
-rw-r--r--db/migrate/20130603150455_create_pager_groups.rb13
-rw-r--r--db/migrate/20130603150603_create_pager_group_destinations.rb13
-rw-r--r--db/migrate/20130612120200_add_gateway_defaults.rb15
17 files changed, 181 insertions, 2 deletions
diff --git a/db/migrate/20120119154952_area_codes_germany.rb b/db/migrate/20120119154952_area_codes_germany.rb
index 6a4ce56..567734f 100644
--- a/db/migrate/20120119154952_area_codes_germany.rb
+++ b/db/migrate/20120119154952_area_codes_germany.rb
@@ -5214,7 +5214,7 @@ class AreaCodesGermany < ActiveRecord::Migration
# Mobilfunknetze
#
'01511, 01512, 01514, 01515, 0160, 0170, 0171, 0175'.gsub(/[^0-9\,]/,'').split(/,/).each do |area_code|
- AreaCode.create(:country => germany, :name => "D1 Mobilfunknetz (Telekom)", :area_code => area_code.gsub(/^0/,''))
+ AreaCode.create(:country => germany, :name => "Telekom Mobilfunknetz", :area_code => area_code.gsub(/^0/,''))
end
'01520, 01522, 01525, 0162, 0172, 0173, 0174'.gsub(/[^0-9\,]/,'').split(/,/).each do |area_code|
@@ -5226,7 +5226,7 @@ class AreaCodesGermany < ActiveRecord::Migration
end
'0176, 0179, 0159, 01505'.gsub(/[^0-9\,]/,'').split(/,/).each do |area_code|
- AreaCode.create(:country => germany, :name => "O2 Mobilfunknetz", :area_code => area_code.gsub(/^0/,''))
+ AreaCode.create(:country => germany, :name => "o2 Mobilfunknetz", :area_code => area_code.gsub(/^0/,''))
end
# Sondervorwahlen
diff --git a/db/migrate/20130224091700_add_initial_groups.rb b/db/migrate/20130224091700_add_initial_groups.rb
index f680fb6..90fbcdb 100644
--- a/db/migrate/20130224091700_add_initial_groups.rb
+++ b/db/migrate/20130224091700_add_initial_groups.rb
@@ -6,6 +6,7 @@ class AddInitialGroups < ActiveRecord::Migration
user_sip_accounts = Group.create(:name => 'user_sip_accounts', :active => true, :comment => 'SIP accounts owned by user accounts')
user_sip_accounts.group_permissions.create(:permission => 'pickup', :target_group_id => user_sip_accounts.id)
+ user_sip_accounts.group_permissions.create(:permission => 'presence', :target_group_id => user_sip_accounts.id)
Group.create(:name => 'international_calls', :active => true, :comment => 'International calls permitted')
Group.create(:name => 'national_calls', :active => true, :comment => 'National calls permitted')
diff --git a/db/migrate/20130322081621_create_voicemail_accounts.rb b/db/migrate/20130322081621_create_voicemail_accounts.rb
new file mode 100644
index 0000000..8567adb
--- /dev/null
+++ b/db/migrate/20130322081621_create_voicemail_accounts.rb
@@ -0,0 +1,17 @@
+class CreateVoicemailAccounts < ActiveRecord::Migration
+ def self.up
+ create_table :voicemail_accounts do |t|
+ t.string :uuid
+ t.string :name
+ t.boolean :active
+ t.integer :gs_node_id
+ t.string :voicemail_accountable_type
+ t.integer :voicemail_accountable_id
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :voicemail_accounts
+ end
+end
diff --git a/db/migrate/20130322102533_add_voicemail_account_id_to_sip_accounts.rb b/db/migrate/20130322102533_add_voicemail_account_id_to_sip_accounts.rb
new file mode 100644
index 0000000..60f5883
--- /dev/null
+++ b/db/migrate/20130322102533_add_voicemail_account_id_to_sip_accounts.rb
@@ -0,0 +1,5 @@
+class AddVoicemailAccountIdToSipAccounts < ActiveRecord::Migration
+ def change
+ add_column :sip_accounts, :voicemail_account_id, :integer
+ end
+end
diff --git a/db/migrate/20130326064557_create_voicemail_settings.rb b/db/migrate/20130326064557_create_voicemail_settings.rb
new file mode 100644
index 0000000..45b6573
--- /dev/null
+++ b/db/migrate/20130326064557_create_voicemail_settings.rb
@@ -0,0 +1,16 @@
+class CreateVoicemailSettings < ActiveRecord::Migration
+ def self.up
+ create_table :voicemail_settings do |t|
+ t.integer :voicemail_account_id
+ t.string :name
+ t.string :value
+ t.string :class_type
+ t.string :description
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :voicemail_settings
+ end
+end
diff --git a/db/migrate/20130403200754_add_reload_timer_to_switchboard.rb b/db/migrate/20130403200754_add_reload_timer_to_switchboard.rb
new file mode 100644
index 0000000..8689c5f
--- /dev/null
+++ b/db/migrate/20130403200754_add_reload_timer_to_switchboard.rb
@@ -0,0 +1,7 @@
+class AddReloadTimerToSwitchboard < ActiveRecord::Migration
+ def change
+ add_column :switchboards, :reload_interval, :integer
+ add_column :switchboards, :show_avatars, :boolean
+ add_column :switchboards, :entry_width, :integer
+ end
+end
diff --git a/db/migrate/20130404094648_add_amount_of_displayed_phone_numbers_to_switchboard.rb b/db/migrate/20130404094648_add_amount_of_displayed_phone_numbers_to_switchboard.rb
new file mode 100644
index 0000000..2f88ad4
--- /dev/null
+++ b/db/migrate/20130404094648_add_amount_of_displayed_phone_numbers_to_switchboard.rb
@@ -0,0 +1,17 @@
+class AddAmountOfDisplayedPhoneNumbersToSwitchboard < ActiveRecord::Migration
+ def up
+ add_column :switchboards, :amount_of_displayed_phone_numbers, :integer
+
+ # Set a default for existing entries of
+ # 1 for amount_of_displayed_phone_numbers
+ #
+ Switchboard.all.each do |switchboard|
+ switchboard.amount_of_displayed_phone_numbers = 1
+ switchboard.save
+ end
+ end
+
+ def down
+ remove_column :switchboards, :amount_of_displayed_phone_numbers, :integer
+ end
+end
diff --git a/db/migrate/20130410123523_create_generic_files.rb b/db/migrate/20130410123523_create_generic_files.rb
new file mode 100644
index 0000000..a91f341
--- /dev/null
+++ b/db/migrate/20130410123523_create_generic_files.rb
@@ -0,0 +1,17 @@
+class CreateGenericFiles < ActiveRecord::Migration
+ def self.up
+ create_table :generic_files do |t|
+ t.string :name
+ t.string :file
+ t.string :file_type
+ t.string :category
+ t.integer :owner_id
+ t.string :owner_type
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :generic_files
+ end
+end
diff --git a/db/migrate/20130411151900_add_presence_permission_to_groups.rb b/db/migrate/20130411151900_add_presence_permission_to_groups.rb
new file mode 100644
index 0000000..84f021d
--- /dev/null
+++ b/db/migrate/20130411151900_add_presence_permission_to_groups.rb
@@ -0,0 +1,11 @@
+class AddPresencePermissionToGroups < ActiveRecord::Migration
+ def up
+ user_sip_accounts = Group.where(:name => 'user_sip_accounts').first
+ if user_sip_accounts
+ user_sip_accounts.group_permissions.create(:permission => 'presence', :target_group_id => user_sip_accounts.id)
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20130506093400_add_idle_text_gs_parameters.rb b/db/migrate/20130506093400_add_idle_text_gs_parameters.rb
new file mode 100644
index 0000000..72416d5
--- /dev/null
+++ b/db/migrate/20130506093400_add_idle_text_gs_parameters.rb
@@ -0,0 +1,9 @@
+class AddIdleTextGsParameters < ActiveRecord::Migration
+ def up
+ GsParameter.create(:entity => 'phones', :section => 'snom', :name => 'user_idle_text', :value => '{caller_name}', :class_type => 'String', :description => 'Name shown on the idle screen')
+ end
+
+ def down
+ GsParameter.where(:entity => 'phones', :section => 'snom', :name => 'user_idle_text').destroy_all
+ end
+end
diff --git a/db/migrate/20130507095000_add_display_id_unicode_gs_parameters.rb b/db/migrate/20130507095000_add_display_id_unicode_gs_parameters.rb
new file mode 100644
index 0000000..9b6ec66
--- /dev/null
+++ b/db/migrate/20130507095000_add_display_id_unicode_gs_parameters.rb
@@ -0,0 +1,9 @@
+class AddDisplayIdUnicodeGsParameters < ActiveRecord::Migration
+ def up
+ GsParameter.create(:entity => 'phones', :section => 'siemens', :name => 'display-id-unicode', :value => '{caller_name}', :class_type => 'String', :description => 'Name shown on the idle screen')
+ end
+
+ def down
+ GsParameter.where(:entity => 'phones', :section => 'siemens', :name => 'display-id-unicode').destroy_all
+ end
+end
diff --git a/db/migrate/20130524140600_add_switchable_to_switchboard_entry.rb b/db/migrate/20130524140600_add_switchable_to_switchboard_entry.rb
new file mode 100644
index 0000000..2e5e46d
--- /dev/null
+++ b/db/migrate/20130524140600_add_switchable_to_switchboard_entry.rb
@@ -0,0 +1,5 @@
+class AddSwitchableToSwitchboardEntry < ActiveRecord::Migration
+ def change
+ add_column :switchboard_entries, :switchable, :boolean
+ end
+end
diff --git a/db/migrate/20130530123600_add_perimeter_report_url.rb b/db/migrate/20130530123600_add_perimeter_report_url.rb
new file mode 100644
index 0000000..4b51b00
--- /dev/null
+++ b/db/migrate/20130530123600_add_perimeter_report_url.rb
@@ -0,0 +1,9 @@
+class AddPerimeterReportUrl < ActiveRecord::Migration
+ def up
+ GsParameter.create(:entity => 'perimeter', :section => 'general', :name => 'report_url', :value => 'http://fire-support.herokuapp.com/intruders/{received_ip}/report.xml?serial={serial}&blacklisted={blacklisted}&suspicious=true', :class_type => 'String', :description => '')
+ end
+
+ def down
+ GsParameter.where(:entity => 'perimeter', :section => 'general', :name => 'report_url').destroy_all
+ end
+end
diff --git a/db/migrate/20130531063549_create_geo_ip_countries.rb b/db/migrate/20130531063549_create_geo_ip_countries.rb
new file mode 100644
index 0000000..9124756
--- /dev/null
+++ b/db/migrate/20130531063549_create_geo_ip_countries.rb
@@ -0,0 +1,15 @@
+class CreateGeoIpCountries < ActiveRecord::Migration
+ def change
+ create_table :geo_ip_countries do |t|
+ t.string :from, :limit => '15'
+ t.string :to, :limit => '15'
+ t.integer :n_from
+ t.integer :n_to
+ t.integer :country_id
+ t.string :country_code, :limit => '2'
+ t.string :country_name, :limit => '64'
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20130603150455_create_pager_groups.rb b/db/migrate/20130603150455_create_pager_groups.rb
new file mode 100644
index 0000000..c8b2e46
--- /dev/null
+++ b/db/migrate/20130603150455_create_pager_groups.rb
@@ -0,0 +1,13 @@
+class CreatePagerGroups < ActiveRecord::Migration
+ def self.up
+ create_table :pager_groups do |t|
+ t.integer :sip_account_id
+ t.string :callback_url
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :pager_groups
+ end
+end
diff --git a/db/migrate/20130603150603_create_pager_group_destinations.rb b/db/migrate/20130603150603_create_pager_group_destinations.rb
new file mode 100644
index 0000000..427dba0
--- /dev/null
+++ b/db/migrate/20130603150603_create_pager_group_destinations.rb
@@ -0,0 +1,13 @@
+class CreatePagerGroupDestinations < ActiveRecord::Migration
+ def self.up
+ create_table :pager_group_destinations do |t|
+ t.integer :pager_group_id
+ t.integer :sip_account_id
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :pager_group_destinations
+ end
+end
diff --git a/db/migrate/20130612120200_add_gateway_defaults.rb b/db/migrate/20130612120200_add_gateway_defaults.rb
new file mode 100644
index 0000000..eddba9d
--- /dev/null
+++ b/db/migrate/20130612120200_add_gateway_defaults.rb
@@ -0,0 +1,15 @@
+class AddGatewayDefaults < ActiveRecord::Migration
+ def up
+ GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'domain', :value => '192.168.1.1', :class_type => 'String')
+ GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'auth_source', :value => 'sip_received_ip', :class_type => 'String')
+ GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'auth_pattern', :value => '^192.168.1.1$', :class_type => 'String')
+ GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'from', :value => '"{caller_id_name}" <sip:{caller_id_number}@{domain}>', :class_type => 'String')
+ GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'from_clir', :value => '"Anonymous" <sip:anonymous@{domain}>', :class_type => 'String')
+ GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'asserted_identity', :value => '"{caller_id_name}" <sip:{caller_id_number}@{domain}>', :class_type => 'String')
+ GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'asserted_identity_clir', :value => '"Anonymous" <sip:{caller_id_number}@{domain}>', :class_type => 'String')
+ end
+
+ def down
+ GsParameter.where(:entity => 'sip_gateways', :section => 'settings').destroy_all
+ end
+end