diff --git a/db/migrate/20160422000003_create_cti_log.rb b/db/migrate/20160422000003_create_cti_log.rb index 4f145cd32..5431a1a5d 100644 --- a/db/migrate/20160422000003_create_cti_log.rb +++ b/db/migrate/20160422000003_create_cti_log.rb @@ -9,12 +9,30 @@ class CreateCtiLog < ActiveRecord::Migration t.string :to_comment, limit: 250, null: true t.string :call_id, limit: 250, null: false t.string :comment, limit: 500, null: true + t.timestamp :start, null: true + t.timestamp :end, null: true + t.boolean :done, null: false, default: true t.timestamps null: false end add_index :cti_logs, [:call_id], unique: true add_index :cti_logs, [:direction] add_index :cti_logs, [:from] + create_table :cti_caller_ids do |t| + t.string :caller_id, limit: 100, null: false + t.string :comment, limit: 500, null: true + t.string :level, limit: 100, null: false + t.string :object, limit: 100, null: false + t.integer :o_id, null: false + t.integer :user_id, null: true + t.text :preferences, limit: 500.kilobytes + 1, null: true + t.timestamps null: false + end + add_index :cti_caller_ids, [:caller_id] + add_index :cti_caller_ids, [:caller_id, :level] + add_index :cti_caller_ids, [:caller_id, :user_id] + add_index :cti_caller_ids, [:object, :o_id] + # return if it's a new setup return if !Setting.find_by(name: 'system_init_done') @@ -25,5 +43,15 @@ class CreateCtiLog < ActiveRecord::Migration created_by_id: 1 ) + Setting.create_if_not_exists( + title: 'Define transaction backend.', + name: '9100_cti_caller_id_detection', + area: 'Transaction::Backend', + description: 'Define the transaction backend which detects caller ids in objects and store them for cti lookups.', + options: {}, + state: 'Transaction::CtiCallerIdDetection', + frontend: false + ) + end end diff --git a/db/migrate/20160427000001_update_cti_log.rb b/db/migrate/20160427000001_update_cti_log.rb deleted file mode 100644 index 85c3d5eb9..000000000 --- a/db/migrate/20160427000001_update_cti_log.rb +++ /dev/null @@ -1,7 +0,0 @@ -class UpdateCtiLog < ActiveRecord::Migration - def up - add_column :cti_logs, :start, :timestamp, null: true - add_column :cti_logs, :end, :timestamp, null: true - add_column :cti_logs, :done, :boolean, null: false, default: true - end -end diff --git a/db/migrate/20160428000001_create_cti_caller_id.rb b/db/migrate/20160428000001_create_cti_caller_id.rb deleted file mode 100644 index bcd699e76..000000000 --- a/db/migrate/20160428000001_create_cti_caller_id.rb +++ /dev/null @@ -1,19 +0,0 @@ -class CreateCtiCallerId < ActiveRecord::Migration - def up - - create_table :cti_caller_ids do |t| - t.string :caller_id, limit: 100, null: false - t.string :comment, limit: 500, null: true - t.string :level, limit: 100, null: false - t.string :object, limit: 100, null: false - t.integer :o_id, null: false - t.integer :user_id, null: true - t.timestamps null: false - end - add_index :cti_caller_ids, [:caller_id] - add_index :cti_caller_ids, [:caller_id, :level] - add_index :cti_caller_ids, [:caller_id, :user_id] - add_index :cti_caller_ids, [:object, :o_id] - - end -end diff --git a/db/migrate/20160429000001_update_cti_caller_id.rb b/db/migrate/20160429000001_update_cti_caller_id.rb deleted file mode 100644 index fef62ba23..000000000 --- a/db/migrate/20160429000001_update_cti_caller_id.rb +++ /dev/null @@ -1,14 +0,0 @@ -class UpdateCtiCallerId < ActiveRecord::Migration - def up - Setting.create_if_not_exists( - title: 'Define transaction backend.', - name: '9100_cti_caller_id_detection', - area: 'Transaction::Backend', - description: 'Define the transaction backend which detects caller ids in objects and store them for cti lookups.', - options: {}, - state: 'Transaction::CtiCallerIdDetection', - frontend: false - ) - add_column :cti_logs, :preferences, :text, limit: 500.kilobytes + 1, null: true - end -end