summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20130105120126_create_gs_parameters.rb16
-rw-r--r--db/migrate/20130105120353_populate_gs_parameter_with_defaults.rb103
-rw-r--r--db/schema.rb12
-rw-r--r--db/to-dos/20120119160732_emergency_numbers_germany.rb4
4 files changed, 132 insertions, 3 deletions
diff --git a/db/migrate/20130105120126_create_gs_parameters.rb b/db/migrate/20130105120126_create_gs_parameters.rb
new file mode 100644
index 0000000..b8b915b
--- /dev/null
+++ b/db/migrate/20130105120126_create_gs_parameters.rb
@@ -0,0 +1,16 @@
+class CreateGsParameters < ActiveRecord::Migration
+ def self.up
+ create_table :gs_parameters do |t|
+ t.string :name
+ t.string :section
+ t.text :value
+ t.string :class_type
+ t.string :description
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :gs_parameters
+ end
+end
diff --git a/db/migrate/20130105120353_populate_gs_parameter_with_defaults.rb b/db/migrate/20130105120353_populate_gs_parameter_with_defaults.rb
new file mode 100644
index 0000000..a4c9358
--- /dev/null
+++ b/db/migrate/20130105120353_populate_gs_parameter_with_defaults.rb
@@ -0,0 +1,103 @@
+class PopulateGsParameterWithDefaults < ActiveRecord::Migration
+ def up
+ # Generic
+ #
+ GsParameter.create(:name => 'GEMEINSCHAFT_VERSION', :section => 'Generic', :value => '5.0.2-nightly-build', :class_type => 'String')
+ GsParameter.create(:name => 'SUPER_TENANT_NAME', :section => 'Generic', :value => 'Super-Tenant', :class_type => 'String')
+
+ # System defaults
+ #
+ GsParameter.create(:name => 'MINIMUM_PIN_LENGTH', :section => 'System defaults', :value => '4', :class_type => 'Integer')
+ GsParameter.create(:name => 'MAXIMUM_PIN_LENGTH', :section => 'System defaults', :value => '10', :class_type => 'Integer')
+
+ # GUI
+ #
+ GsParameter.create(:name => 'GUI_REDIRECT_HTTPS', :section => 'GUI', :value => 'false', :class_type => 'Boolean')
+
+ # Phone numbers
+ # Only touch this if you know what you are doing!
+ #
+ GsParameter.create(:name => 'STRICT_INTERNAL_EXTENSION_HANDLING', :section => 'Phone numbers', :value => 'false', :class_type => 'Boolean')
+ GsParameter.create(:name => 'STRICT_DID_HANDLING', :section => 'Phone numbers', :value => 'false', :class_type => 'Boolean')
+
+ # SIP defaults
+ #
+ GsParameter.create(:name => 'DEFAULT_LENGTH_SIP_AUTH_NAME', :section => 'SIP Defaults', :value => '10', :class_type => 'Integer')
+ GsParameter.create(:name => 'DEFAULT_LENGTH_SIP_PASSWORD', :section => 'SIP Defaults', :value => '15', :class_type => 'Integer')
+ GsParameter.create(:name => 'CALL_WAITING', :section => 'SIP Defaults', :value => 'false', :class_type => 'Boolean')
+ GsParameter.create(:name => 'DEFAULT_CLIR_SETTING', :section => 'SIP Defaults', :value => 'false', :class_type => 'Boolean')
+ GsParameter.create(:name => 'DEFAULT_CLIP_SETTING', :section => 'SIP Defaults', :value => 'true', :class_type => 'Boolean')
+ GsParameter.create(:name => 'TO_S_MAX_CALLER_NAME_LENGTH', :section => 'SIP Defaults', :value => '25', :class_type => 'Integer')
+ GsParameter.create(:name => 'TO_S_MAX_LENGTH_OF_AUTH_NAME', :section => 'SIP Defaults', :value => '6', :class_type => 'Integer')
+
+ # Pagination defaults
+ #
+ GsParameter.create(:name => 'DEFAULT_PAGINATION_ENTRIES_PER_PAGE', :section => 'Pagination defaults', :value => '50', :class_type => 'Integer')
+
+ # Conference defaults
+ #
+ GsParameter.create(:name => 'MAXIMUM_NUMBER_OF_PEOPLE_IN_A_CONFERENCE', :section => 'Conference defaults', :value => '100', :class_type => 'Integer')
+ GsParameter.create(:name => 'DEFAULT_MAX_CONFERENCE_MEMBERS', :section => 'Conference defaults', :value => '10', :class_type => 'Integer')
+
+ # Misc defaults
+ #
+ GsParameter.create(:name => 'MAX_EXTENSION_LENGTH', :section => 'Misc defaults', :value => '6', :class_type => 'Integer')
+
+ # Fax defaults
+ #
+ GsParameter.create(:name => 'DEFAULT_NUMBER_OF_RETRIES', :section => 'Fax defaults', :value => '3', :class_type => 'Integer')
+ GsParameter.create(:name => 'DAYS_TILL_AUTO_DELETE', :section => 'Fax defaults', :value => '90', :class_type => 'Integer')
+
+ # Names of PhoneNumberRanges
+ #
+ GsParameter.create(:name => 'INTERNAL_EXTENSIONS', :section => 'PhoneNumberRanges defaults', :value => 'internal_extensions', :class_type => 'String')
+ GsParameter.create(:name => 'SERVICE_NUMBERS', :section => 'PhoneNumberRanges defaults', :value => 'service_numbers', :class_type => 'String')
+ GsParameter.create(:name => 'DIRECT_INWARD_DIALING_NUMBERS', :section => 'PhoneNumberRanges defaults', :value => 'direct_inward_dialing_numbers', :class_type => 'String')
+
+ # Callthrough defaults
+ #
+ GsParameter.create(:name => 'CALLTHROUGH_HAS_WHITELISTS', :section => 'Callthrough defaults', :value => 'true', :class_type => 'Boolean')
+
+ # Huntgroup defaults
+ #
+ GsParameter.create(:name => 'HUNT_GROUP_STRATEGIES', :section => 'Huntgroup defaults', :value => ['ring_all', 'ring_recursively'].to_yaml, :class_type => 'YAML')
+ GsParameter.create(:name => 'VALID_SECONDS_BETWEEN_JUMPS_VALUES', :section => 'Huntgroup defaults', :value => (1 .. 60).to_a.map{|x| x * 2}.to_yaml, :class_type => 'YAML')
+
+ # Callforward defaults
+ #
+ GsParameter.create(:name => 'DEFAULT_CALL_FORWARD_DEPTH', :section => 'Callforward defaults', :value => '1', :class_type => 'Integer')
+ GsParameter.create(:name => 'MAX_CALL_FORWARD_DEPTH', :section => 'Callforward defaults', :value => '40', :class_type => 'Integer')
+ GsParameter.create(:name => 'CALLFORWARD_DESTINATION_DEFAULT', :section => 'Callforward defaults', :value => '+49', :class_type => 'String')
+ GsParameter.create(:name => 'CALLFORWARD_RULES_ACT_PER_SIP_ACCOUNT_DEFAULT', :section => 'Callforward defaults', :value => 'true', :class_type => 'Boolean')
+
+ # Phone
+ #
+ GsParameter.create(:name => 'PROVISIONING_AUTO_ADD_PHONE', :section => 'Phone', :value => 'true', :class_type => 'Boolean')
+ GsParameter.create(:name => 'PROVISIONING_AUTO_ADD_SIP_ACCOUNT', :section => 'Phone', :value => 'true', :class_type => 'Boolean')
+ GsParameter.create(:name => 'PROVISIONING_AUTO_TENANT_ID', :section => 'Phone', :value => '2', :class_type => 'Integer')
+ GsParameter.create(:name => 'PROVISIONING_AUTO_SIP_ACCOUNT_CALLER_PREFIX', :section => 'Phone', :value => 'Gemeinschaft ', :class_type => 'String')
+ GsParameter.create(:name => 'PROVISIONING_IEEE8021X_EAP_USERNAME', :section => 'Phone', :value => '', :class_type => 'String')
+ GsParameter.create(:name => 'PROVISIONING_IEEE8021X_EAP_PASSWORD', :section => 'Phone', :value => '', :class_type => 'String')
+ GsParameter.create(:name => 'NIGHTLY_REBOOT_OF_PHONES', :section => 'Phone', :value => 'true', :class_type => 'Boolean')
+ GsParameter.create(:name => 'SIEMENS_HISTORY_RELOAD_TIMES', :section => 'Phone', :value => {0..6 => 600, 7..20 => 40, 21..24 => 300}.to_yaml, :class_type => 'YAML')
+
+ # API configuration
+ #
+ GsParameter.create(:name => 'DEFAULT_API_TENANT_ID', :section => 'API configuration', :value => '2', :class_type => 'Integer')
+ GsParameter.create(:name => 'REMOTE_IP_ADDRESS_WHITELIST', :section => 'API configuration', :value => [].to_yaml, :class_type => 'YAML') # e.g. ['10.0.0.1']
+ GsParameter.create(:name => 'IMPORT_CSV_FILE', :section => 'API configuration', :value => '/var/tmp/ExampleVoipCsvExport.csv', :class_type => 'String')
+ GsParameter.create(:name => 'DOUBLE_CHECK_POSITIVE_USERS_CSV', :section => 'API configuration', :value => '/var/tmp/ExampleDoubleCheckVoipCsvExport.csv', :class_type => 'String')
+ GsParameter.create(:name => 'IMPORT_CSV_ENCODING', :section => 'API configuration', :value => 'UTF-8', :class_type => 'String')
+ GsParameter.create(:name => 'USER_NAME_PREFIX', :section => 'API configuration', :value => 'dtc', :class_type => 'String')
+ GsParameter.create(:name => 'CALLTHROUGH_NAME_TO_BE_USED_FOR_DEFAULT_ACTIVATION', :section => 'API configuration', :value => 'Callthrough for employees', :class_type => 'String')
+
+ # GS Cluster configuration
+ #
+ GsParameter.create(:name => 'WRITE_GS_CLUSTER_SYNC_LOG', :section => 'GS Cluster ', :value => 'true', :class_type => 'Boolean')
+ GsParameter.create(:name => 'HOMEBASE_IP_ADDRESS', :section => 'GS Cluster ', :value => '0.0.0.0', :class_type => 'String')
+ end
+
+ def down
+ GsParameter.destroy_all
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 12114dc..e8b3c4a 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 => 20121230110747) do
+ActiveRecord::Schema.define(:version => 20130105120353) do
create_table "access_authorizations", :force => true do |t|
t.string "access_authorizationable_type"
@@ -526,6 +526,16 @@ ActiveRecord::Schema.define(:version => 20121230110747) do
t.datetime "last_sync"
end
+ create_table "gs_parameters", :force => true do |t|
+ t.string "name"
+ t.string "section"
+ t.text "value"
+ t.string "class_type"
+ t.string "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "gui_function_memberships", :force => true do |t|
t.integer "gui_function_id"
t.integer "user_group_id"
diff --git a/db/to-dos/20120119160732_emergency_numbers_germany.rb b/db/to-dos/20120119160732_emergency_numbers_germany.rb
index 9dd9131..f0c02d9 100644
--- a/db/to-dos/20120119160732_emergency_numbers_germany.rb
+++ b/db/to-dos/20120119160732_emergency_numbers_germany.rb
@@ -11,7 +11,7 @@ class EmergencyNumbersGermany < ActiveRecord::Migration
################################################################
# Emergency numbers which shouldn't be used as extensions
################################################################
- notruf_nummern = germany.phone_number_ranges.find_or_create_by_name(SERVICE_NUMBERS)
+ notruf_nummern = germany.phone_number_ranges.find_or_create_by_name(GsParameter.get('SERVICE_NUMBERS'))
notruf_nummern.phone_numbers.find_or_create_by_name_and_number('Polizei', '110')
notruf_nummern.phone_numbers.find_or_create_by_name_and_number('Feuerwehr', '112')
notruf_nummern.phone_numbers.find_or_create_by_name_and_number('Zentrale Behördenrufnummer', '115')
@@ -25,6 +25,6 @@ class EmergencyNumbersGermany < ActiveRecord::Migration
def down
germany = Country.find_by_name('Germany')
- germany.phone_number_ranges.where(:name => SERVICE_NUMBERS).destroy_all
+ germany.phone_number_ranges.where(:name => GsParameter.get('SERVICE_NUMBERS')).destroy_all
end
end