summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 12:22:29 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-27 12:22:29 +0100
commit67c1a0a951403a546250ea860a3e3d199cae2fce (patch)
treef86ec6cedf081a1a57005eca1661e9bead34e4de /db
parent5d8ce5f4775ac8bc5f523964e6e36f63ff3c4683 (diff)
parent211f558a86ae30cdd5b392ab1376e1393f97e22c (diff)
Merge branch 'develop'5.1-beta6
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20130109090000_populate_gs_parameter_with_dialplan_defaults.rb4
-rw-r--r--db/migrate/20130213110000_add_sounds_to_parameters.rb2
-rw-r--r--db/migrate/20130219135000_remove_sound_prefix_from_conference_parameters.rb8
-rw-r--r--db/migrate/20130222074610_create_groups.rb14
-rw-r--r--db/migrate/20130222074652_create_group_memberships.rb14
-rw-r--r--db/migrate/20130222092313_create_group_permissions.rb14
-rw-r--r--db/migrate/20130224081700_groups_to_user_groups_in_routes.rb19
-rw-r--r--db/migrate/20130224091700_add_initial_groups.rb22
-rw-r--r--db/migrate/20130225091200_add_destinationable_to_call_forward.rb21
-rw-r--r--db/migrate/20130225160423_create_restore_jobs.rb13
-rw-r--r--db/schema.rb33
11 files changed, 160 insertions, 4 deletions
diff --git a/db/migrate/20130109090000_populate_gs_parameter_with_dialplan_defaults.rb b/db/migrate/20130109090000_populate_gs_parameter_with_dialplan_defaults.rb
index fe1cdae..a8350a3 100644
--- a/db/migrate/20130109090000_populate_gs_parameter_with_dialplan_defaults.rb
+++ b/db/migrate/20130109090000_populate_gs_parameter_with_dialplan_defaults.rb
@@ -79,7 +79,7 @@ class PopulateGsParameterWithDialplanDefaults < ActiveRecord::Migration
GsParameter.create(:entity => 'conferences', :section => 'parameters', :name => 'rate', :value => 16000, :class_type => 'Integer')
GsParameter.create(:entity => 'conferences', :section => 'parameters', :name => 'interval', :value => 20, :class_type => 'Integer')
GsParameter.create(:entity => 'conferences', :section => 'parameters', :name => 'energy-level', :value => 300, :class_type => 'Integer')
- GsParameter.create(:entity => 'conferences', :section => 'parameters', :name => 'sound-prefix', :value => '/opt/freeswitch/sounds/en/us/callie', :class_type => 'String')
+ GsParameter.create(:entity => 'conferences', :section => 'parameters', :name => 'sound-prefix', :value => '/opt/freeswitch/sounds/de/tts/google', :class_type => 'String')
GsParameter.create(:entity => 'conferences', :section => 'parameters', :name => 'muted-sound', :value => 'conference/conf-muted.wav', :class_type => 'String')
GsParameter.create(:entity => 'conferences', :section => 'parameters', :name => 'unmuted-sound', :value => 'conference/conf-unmuted.wav', :class_type => 'String')
GsParameter.create(:entity => 'conferences', :section => 'parameters', :name => 'alone-sound', :value => 'conference/conf-alone.wav', :class_type => 'String')
@@ -101,7 +101,7 @@ class PopulateGsParameterWithDialplanDefaults < ActiveRecord::Migration
GsParameter.create(:entity => 'dialplan', :section => 'parameters', :name => 'dial_timeout', :value => '120', :class_type => 'Integer')
GsParameter.create(:entity => 'dialplan', :section => 'parameters', :name => 'max_loops', :value => '20', :class_type => 'Integer')
GsParameter.create(:entity => 'dialplan', :section => 'parameters', :name => 'default_ringtone', :value => '1', :class_type => 'Integer')
- GsParameter.create(:entity => 'dialplan', :section => 'parameters', :name => 'default_language', :value => 'en', :class_type => 'String')
+ GsParameter.create(:entity => 'dialplan', :section => 'parameters', :name => 'default_language', :value => 'de', :class_type => 'String')
GsParameter.create(:entity => 'dialplan', :section => 'parameters', :name => 'phone_book_entry_image_url', :value => 'http://192.168.0.150/uploads/phone_book_entry/image', :class_type => 'String')
GsParameter.create(:entity => 'dialplan', :section => 'parameters', :name => 'user_image_url', :value => 'http://192.168.0.150/uploads/user/image', :class_type => 'String')
GsParameter.create(:entity => 'dialplan', :section => 'parameters', :name => 'ringtone_url', :value => 'http://192.168.0.150', :class_type => 'String')
diff --git a/db/migrate/20130213110000_add_sounds_to_parameters.rb b/db/migrate/20130213110000_add_sounds_to_parameters.rb
index 8c4cd94..dd20ca3 100644
--- a/db/migrate/20130213110000_add_sounds_to_parameters.rb
+++ b/db/migrate/20130213110000_add_sounds_to_parameters.rb
@@ -1,7 +1,7 @@
class AddSoundsToParameters < ActiveRecord::Migration
def up
GsParameter.create(:entity => 'dialplan', :section => 'sounds', :name => 'en', :value => '/opt/freeswitch/sounds/en/us/callie', :class_type => 'String')
- GsParameter.create(:entity => 'dialplan', :section => 'sounds', :name => 'de', :value => '/opt/freeswitch/sounds/de/de/callie', :class_type => 'String')
+ GsParameter.create(:entity => 'dialplan', :section => 'sounds', :name => 'de', :value => '/opt/freeswitch/sounds/de/tts/google', :class_type => 'String')
end
def down
diff --git a/db/migrate/20130219135000_remove_sound_prefix_from_conference_parameters.rb b/db/migrate/20130219135000_remove_sound_prefix_from_conference_parameters.rb
new file mode 100644
index 0000000..950e3af
--- /dev/null
+++ b/db/migrate/20130219135000_remove_sound_prefix_from_conference_parameters.rb
@@ -0,0 +1,8 @@
+class RemoveSoundPrefixFromConferenceParameters < ActiveRecord::Migration
+ def up
+ GsParameter.where(:entity => 'conferences', :section => 'parameters', :name => 'sound-prefix').destroy_all
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20130222074610_create_groups.rb b/db/migrate/20130222074610_create_groups.rb
new file mode 100644
index 0000000..e5848b9
--- /dev/null
+++ b/db/migrate/20130222074610_create_groups.rb
@@ -0,0 +1,14 @@
+class CreateGroups < ActiveRecord::Migration
+ def self.up
+ create_table :groups do |t|
+ t.string :name
+ t.boolean :active
+ t.string :comment
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :groups
+ end
+end
diff --git a/db/migrate/20130222074652_create_group_memberships.rb b/db/migrate/20130222074652_create_group_memberships.rb
new file mode 100644
index 0000000..e572445
--- /dev/null
+++ b/db/migrate/20130222074652_create_group_memberships.rb
@@ -0,0 +1,14 @@
+class CreateGroupMemberships < ActiveRecord::Migration
+ def self.up
+ create_table :group_memberships do |t|
+ t.integer :group_id
+ t.string :item_type
+ t.integer :item_id
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :group_memberships
+ end
+end
diff --git a/db/migrate/20130222092313_create_group_permissions.rb b/db/migrate/20130222092313_create_group_permissions.rb
new file mode 100644
index 0000000..5949819
--- /dev/null
+++ b/db/migrate/20130222092313_create_group_permissions.rb
@@ -0,0 +1,14 @@
+class CreateGroupPermissions < ActiveRecord::Migration
+ def self.up
+ create_table :group_permissions do |t|
+ t.integer :group_id
+ t.string :permission
+ t.integer :target_group_id
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :group_permissions
+ end
+end
diff --git a/db/migrate/20130224081700_groups_to_user_groups_in_routes.rb b/db/migrate/20130224081700_groups_to_user_groups_in_routes.rb
new file mode 100644
index 0000000..5e03cfa
--- /dev/null
+++ b/db/migrate/20130224081700_groups_to_user_groups_in_routes.rb
@@ -0,0 +1,19 @@
+class GroupsToUserGroupsInRoutes < ActiveRecord::Migration
+ def up
+ RouteElement.where(:var_in => 'val:auth_account.owner.groups').each do |route_element|
+ route_element.update_attributes(:var_in => 'val:auth_account.owner.user_groups')
+ end
+ RouteElement.where(:var_in => 'val:account.owner.groups').each do |route_element|
+ route_element.update_attributes(:var_in => 'val:account.owner.user_groups')
+ end
+ end
+
+ def down
+ RouteElement.where(:var_in => 'val:auth_account.owner.user_groups').each do |route_element|
+ route_element.update_attributes(:var_in => 'val:auth_account.owner.groups')
+ end
+ RouteElement.where(:var_in => 'val:account.owner.user_groups').each do |route_element|
+ route_element.update_attributes(:var_in => 'val:account.owner.groups')
+ end
+ end
+end
diff --git a/db/migrate/20130224091700_add_initial_groups.rb b/db/migrate/20130224091700_add_initial_groups.rb
new file mode 100644
index 0000000..f680fb6
--- /dev/null
+++ b/db/migrate/20130224091700_add_initial_groups.rb
@@ -0,0 +1,22 @@
+class AddInitialGroups < ActiveRecord::Migration
+ def up
+ Group.create(:name => 'admins', :active => true, :comment => 'Administrator user accounts')
+ Group.create(:name => 'users', :active => true, :comment => 'Generic user accounts')
+ Group.create(:name => 'tenant_sip_accounts', :active => true, :comment => 'SIP accounts owned by tenants')
+
+ 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)
+
+ Group.create(:name => 'international_calls', :active => true, :comment => 'International calls permitted')
+ Group.create(:name => 'national_calls', :active => true, :comment => 'National calls permitted')
+
+ GsParameter.create(:entity => 'group', :section => 'default', :name => 'User.admin', :value => '--- [admins]\n', :class_type => 'YAML')
+ GsParameter.create(:entity => 'group', :section => 'default', :name => 'User', :value => '--- [users]\n', :class_type => 'YAML')
+ GsParameter.create(:entity => 'group', :section => 'default', :name => 'SipAccount.user', :value => '--- [user_sip_accounts, international_calls, national_calls]\n', :class_type => 'YAML')
+ GsParameter.create(:entity => 'group', :section => 'default', :name => 'SipAccount.tenant', :value => '--- [tenant_sip_accounts]\n', :class_type => 'YAML')
+ end
+
+ def down
+ Group.destroy_all
+ end
+end
diff --git a/db/migrate/20130225091200_add_destinationable_to_call_forward.rb b/db/migrate/20130225091200_add_destinationable_to_call_forward.rb
new file mode 100644
index 0000000..89e4b3b
--- /dev/null
+++ b/db/migrate/20130225091200_add_destinationable_to_call_forward.rb
@@ -0,0 +1,21 @@
+class AddDestinationableToCallForward < ActiveRecord::Migration
+ def up
+ add_column :call_forwards, :destinationable_type, :string
+ add_column :call_forwards, :destinationable_id, :integer
+
+ CallForward.all.each do |call_forward|
+ call_forward.update_attributes(:destinationable_type => call_forward.call_forwardable_type, :destinationable_id => call_forward.call_forwardable_id, :call_forwardable_type => 'PhoneNumber', :call_forwardable_id => call_forward.phone_number_id )
+ end
+
+ remove_column :call_forwards, :phone_number_id
+ end
+
+ def down
+ add_column :call_forwards, :phone_number_id, :integer
+ CallForward.where(:call_forwardable_type => 'PhoneNumber').each do |call_forward|
+ call_forward.update_attributes(:phone_number_id => call_forward.call_forwardable_id, :call_forwardable_type => call_forward.destinationable_type, :call_forwardable_id => call_forward.destinationable_id)
+ end
+ remove_column :call_forwards, :destinationable_type
+ remove_column :call_forwards, :destinationable_id
+ end
+end
diff --git a/db/migrate/20130225160423_create_restore_jobs.rb b/db/migrate/20130225160423_create_restore_jobs.rb
new file mode 100644
index 0000000..9f83791
--- /dev/null
+++ b/db/migrate/20130225160423_create_restore_jobs.rb
@@ -0,0 +1,13 @@
+class CreateRestoreJobs < ActiveRecord::Migration
+ def self.up
+ create_table :restore_jobs do |t|
+ t.string :state
+ t.string :backup_file
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :restore_jobs
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index df55604..60bc7f5 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 => 20130215133749) do
+ActiveRecord::Schema.define(:version => 20130225160423) do
create_table "access_authorizations", :force => true do |t|
t.string "access_authorizationable_type"
@@ -554,6 +554,30 @@ ActiveRecord::Schema.define(:version => 20130215133749) do
t.string "trunk_access_code"
end
+ create_table "group_memberships", :force => true do |t|
+ t.integer "group_id"
+ t.string "item_type"
+ t.integer "item_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "group_permissions", :force => true do |t|
+ t.integer "group_id"
+ t.string "permission"
+ t.integer "target_group_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "groups", :force => true do |t|
+ t.string "name"
+ t.boolean "active"
+ t.string "comment"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "gs_cluster_sync_log_entries", :force => true do |t|
t.integer "gs_node_id"
t.string "class_name"
@@ -854,6 +878,13 @@ ActiveRecord::Schema.define(:version => 20130215133749) do
add_index "registrations", ["reg_user", "realm", "hostname"], :name => "regindex1"
+ create_table "restore_jobs", :force => true do |t|
+ t.string "state"
+ t.string "backup_file"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "ringtones", :force => true do |t|
t.string "ringtoneable_type"
t.integer "ringtoneable_id"