2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2017-09-08 08:28:34 +00:00
|
|
|
class CreateTicket < ActiveRecord::Migration[4.2]
|
2012-04-10 14:06:46 +00:00
|
|
|
def up
|
|
|
|
create_table :ticket_state_types do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :note, :string, limit: 250, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2015-04-27 13:42:53 +00:00
|
|
|
add_index :ticket_state_types, [:name], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :ticket_state_types, :users, column: :created_by_id
|
|
|
|
add_foreign_key :ticket_state_types, :users, column: :updated_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :ticket_states do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.references :state_type, null: false
|
2015-09-26 15:31:53 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :next_state_id, :integer, null: true
|
2016-05-20 10:21:55 +00:00
|
|
|
t.column :ignore_escalation, :boolean, null: false, default: false
|
2017-02-12 17:21:03 +00:00
|
|
|
t.column :default_create, :boolean, null: false, default: false
|
|
|
|
t.column :default_follow_up, :boolean, null: false, default: false
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :note, :string, limit: 250, null: true
|
|
|
|
t.column :active, :boolean, null: false, default: true
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2015-04-27 13:42:53 +00:00
|
|
|
add_index :ticket_states, [:name], unique: true
|
2017-02-12 17:21:03 +00:00
|
|
|
add_index :ticket_states, [:default_create]
|
|
|
|
add_index :ticket_states, [:default_follow_up]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :ticket_states, :ticket_state_types, column: :state_type_id
|
|
|
|
add_foreign_key :ticket_states, :users, column: :created_by_id
|
|
|
|
add_foreign_key :ticket_states, :users, column: :updated_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :ticket_priorities do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
2017-02-12 17:21:03 +00:00
|
|
|
t.column :default_create, :boolean, null: false, default: false
|
2019-04-11 05:23:35 +00:00
|
|
|
t.column :ui_icon, :string, limit: 100, null: true
|
|
|
|
t.column :ui_color, :string, limit: 100, null: true
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :note, :string, limit: 250, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :active, :boolean, null: false, default: true
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2015-04-27 13:42:53 +00:00
|
|
|
add_index :ticket_priorities, [:name], unique: true
|
2017-02-12 17:21:03 +00:00
|
|
|
add_index :ticket_priorities, [:default_create]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :ticket_priorities, :users, column: :created_by_id
|
|
|
|
add_foreign_key :ticket_priorities, :users, column: :updated_by_id
|
2017-01-16 13:34:44 +00:00
|
|
|
|
2012-04-10 14:06:46 +00:00
|
|
|
create_table :tickets do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.references :group, null: false
|
|
|
|
t.references :priority, null: false
|
|
|
|
t.references :state, null: false
|
|
|
|
t.references :organization, null: true
|
2016-09-12 06:56:14 +00:00
|
|
|
t.column :number, :string, limit: 60, null: false
|
|
|
|
t.column :title, :string, limit: 250, null: false
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :owner_id, :integer, null: false
|
|
|
|
t.column :customer_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.column :note, :string, limit: 250, null: true
|
2016-09-14 07:15:30 +00:00
|
|
|
t.column :first_response_at, :timestamp, limit: 3, null: true
|
|
|
|
t.column :first_response_escalation_at, :timestamp, limit: 3, null: true
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :first_response_in_min, :integer, null: true
|
|
|
|
t.column :first_response_diff_in_min, :integer, null: true
|
2016-09-14 07:15:30 +00:00
|
|
|
t.column :close_at, :timestamp, limit: 3, null: true
|
|
|
|
t.column :close_escalation_at, :timestamp, limit: 3, null: true
|
|
|
|
t.column :close_in_min, :integer, null: true
|
|
|
|
t.column :close_diff_in_min, :integer, null: true
|
|
|
|
t.column :update_escalation_at, :timestamp, limit: 3, null: true
|
|
|
|
t.column :update_in_min, :integer, null: true
|
|
|
|
t.column :update_diff_in_min, :integer, null: true
|
|
|
|
t.column :last_contact_at, :timestamp, limit: 3, null: true
|
|
|
|
t.column :last_contact_agent_at, :timestamp, limit: 3, null: true
|
|
|
|
t.column :last_contact_customer_at, :timestamp, limit: 3, null: true
|
2017-08-30 13:50:48 +00:00
|
|
|
t.column :last_owner_update_at, :timestamp, limit: 3, null: true
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :create_article_type_id, :integer, null: true
|
|
|
|
t.column :create_article_sender_id, :integer, null: true
|
|
|
|
t.column :article_count, :integer, null: true
|
2016-09-14 07:15:30 +00:00
|
|
|
t.column :escalation_at, :timestamp, limit: 3, null: true
|
2016-09-12 06:56:14 +00:00
|
|
|
t.column :pending_time, :timestamp, limit: 3, null: true
|
|
|
|
t.column :type, :string, limit: 100, null: true
|
2017-01-16 13:41:56 +00:00
|
|
|
t.column :time_unit, :decimal, precision: 6, scale: 2, null: true
|
2020-06-22 09:57:45 +00:00
|
|
|
t.column :preferences, :text, limit: 500.kilobytes + 1, null: true
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2014-12-17 20:19:47 +00:00
|
|
|
add_index :tickets, [:state_id]
|
|
|
|
add_index :tickets, [:priority_id]
|
2012-04-10 14:06:46 +00:00
|
|
|
add_index :tickets, [:group_id]
|
|
|
|
add_index :tickets, [:owner_id]
|
|
|
|
add_index :tickets, [:customer_id]
|
2019-04-07 15:23:03 +00:00
|
|
|
add_index :tickets, %i[customer_id state_id created_at]
|
2015-04-27 13:42:53 +00:00
|
|
|
add_index :tickets, [:number], unique: true
|
2012-04-10 14:06:46 +00:00
|
|
|
add_index :tickets, [:title]
|
|
|
|
add_index :tickets, [:created_at]
|
2019-04-07 15:23:03 +00:00
|
|
|
add_index :tickets, [:updated_at]
|
2016-09-14 07:15:30 +00:00
|
|
|
add_index :tickets, [:first_response_at]
|
|
|
|
add_index :tickets, [:first_response_escalation_at]
|
2014-12-17 20:19:47 +00:00
|
|
|
add_index :tickets, [:first_response_in_min]
|
|
|
|
add_index :tickets, [:first_response_diff_in_min]
|
2016-09-14 07:15:30 +00:00
|
|
|
add_index :tickets, [:close_at]
|
|
|
|
add_index :tickets, [:close_escalation_at]
|
|
|
|
add_index :tickets, [:close_in_min]
|
|
|
|
add_index :tickets, [:close_diff_in_min]
|
|
|
|
add_index :tickets, [:escalation_at]
|
|
|
|
add_index :tickets, [:update_in_min]
|
|
|
|
add_index :tickets, [:update_diff_in_min]
|
|
|
|
add_index :tickets, [:last_contact_at]
|
|
|
|
add_index :tickets, [:last_contact_agent_at]
|
|
|
|
add_index :tickets, [:last_contact_customer_at]
|
2017-08-30 13:50:48 +00:00
|
|
|
add_index :tickets, [:last_owner_update_at]
|
2012-12-27 09:41:02 +00:00
|
|
|
add_index :tickets, [:create_article_type_id]
|
|
|
|
add_index :tickets, [:create_article_sender_id]
|
2012-04-10 14:06:46 +00:00
|
|
|
add_index :tickets, [:created_by_id]
|
2015-09-26 11:32:33 +00:00
|
|
|
add_index :tickets, [:pending_time]
|
|
|
|
add_index :tickets, [:type]
|
2017-01-16 13:34:44 +00:00
|
|
|
add_index :tickets, [:time_unit]
|
2018-12-01 12:02:06 +00:00
|
|
|
add_index :tickets, %i[group_id state_id]
|
|
|
|
add_index :tickets, %i[group_id state_id owner_id]
|
2019-04-07 15:23:03 +00:00
|
|
|
add_index :tickets, %i[group_id state_id updated_at]
|
|
|
|
add_index :tickets, %i[group_id state_id owner_id updated_at], name: 'index_tickets_on_group_id_state_id_owner_id_updated_at'
|
|
|
|
add_index :tickets, %i[group_id state_id created_at]
|
|
|
|
add_index :tickets, %i[group_id state_id owner_id created_at], name: 'index_tickets_on_group_id_state_id_owner_id_created_at'
|
|
|
|
add_index :tickets, %i[group_id state_id close_at]
|
|
|
|
add_index :tickets, %i[group_id state_id owner_id close_at], name: 'index_tickets_on_group_id_state_id_owner_id_close_at'
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :tickets, :groups
|
|
|
|
add_foreign_key :tickets, :users, column: :owner_id
|
|
|
|
add_foreign_key :tickets, :users, column: :customer_id
|
|
|
|
add_foreign_key :tickets, :ticket_priorities, column: :priority_id
|
|
|
|
add_foreign_key :tickets, :ticket_states, column: :state_id
|
|
|
|
add_foreign_key :tickets, :organizations
|
|
|
|
add_foreign_key :tickets, :users, column: :created_by_id
|
|
|
|
add_foreign_key :tickets, :users, column: :updated_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :ticket_flags do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :ticket, null: false
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :key, :string, limit: 50, null: false
|
|
|
|
t.column :value, :string, limit: 50, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2017-11-23 08:09:44 +00:00
|
|
|
add_index :ticket_flags, %i[ticket_id created_by_id]
|
|
|
|
add_index :ticket_flags, %i[ticket_id key]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_index :ticket_flags, [:ticket_id]
|
2012-04-10 14:06:46 +00:00
|
|
|
add_index :ticket_flags, [:created_by_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :ticket_flags, :tickets, column: :ticket_id
|
|
|
|
add_foreign_key :ticket_flags, :users, column: :created_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :ticket_article_types do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :note, :string, limit: 250, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :communication, :boolean, null: false
|
|
|
|
t.column :active, :boolean, null: false, default: true
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2015-04-27 13:42:53 +00:00
|
|
|
add_index :ticket_article_types, [:name], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :ticket_article_types, :users, column: :created_by_id
|
|
|
|
add_foreign_key :ticket_article_types, :users, column: :updated_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :ticket_article_senders do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :note, :string, limit: 250, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2015-04-27 13:42:53 +00:00
|
|
|
add_index :ticket_article_senders, [:name], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :ticket_article_senders, :users, column: :created_by_id
|
|
|
|
add_foreign_key :ticket_article_senders, :users, column: :updated_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :ticket_articles do |t|
|
2015-09-27 21:34:21 +00:00
|
|
|
t.references :ticket, null: false
|
|
|
|
t.references :type, null: false
|
|
|
|
t.references :sender, null: false
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :from, :string, limit: 3000, null: true
|
|
|
|
t.column :to, :string, limit: 3000, null: true
|
|
|
|
t.column :cc, :string, limit: 3000, null: true
|
|
|
|
t.column :subject, :string, limit: 3000, null: true
|
2017-04-27 07:54:38 +00:00
|
|
|
t.column :reply_to, :string, limit: 300, null: true
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :message_id, :string, limit: 3000, null: true
|
|
|
|
t.column :message_id_md5, :string, limit: 32, null: true
|
|
|
|
t.column :in_reply_to, :string, limit: 3000, null: true
|
2015-07-01 01:08:01 +00:00
|
|
|
t.column :content_type, :string, limit: 20, null: false, default: 'text/plain'
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :references, :string, limit: 3200, null: true
|
2016-05-09 14:55:31 +00:00
|
|
|
t.column :body, :text, limit: 20.megabytes + 1, null: false
|
2020-06-22 09:57:45 +00:00
|
|
|
t.column :internal, :boolean, null: false, default: false
|
|
|
|
t.column :preferences, :text, limit: 500.kilobytes + 1, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2017-04-25 14:06:23 +00:00
|
|
|
t.column :origin_by_id, :integer
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
|
|
|
add_index :ticket_articles, [:ticket_id]
|
|
|
|
add_index :ticket_articles, [:message_id_md5]
|
2017-11-23 08:09:44 +00:00
|
|
|
add_index :ticket_articles, %i[message_id_md5 type_id], name: 'index_ticket_articles_message_id_md5_type_id'
|
2012-04-10 14:06:46 +00:00
|
|
|
add_index :ticket_articles, [:created_by_id]
|
2014-03-18 10:39:04 +00:00
|
|
|
add_index :ticket_articles, [:created_at]
|
2012-04-10 14:06:46 +00:00
|
|
|
add_index :ticket_articles, [:internal]
|
2014-12-17 20:19:47 +00:00
|
|
|
add_index :ticket_articles, [:type_id]
|
|
|
|
add_index :ticket_articles, [:sender_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :ticket_articles, :tickets
|
|
|
|
add_foreign_key :ticket_articles, :ticket_article_types, column: :type_id
|
|
|
|
add_foreign_key :ticket_articles, :ticket_article_senders, column: :sender_id
|
|
|
|
add_foreign_key :ticket_articles, :users, column: :created_by_id
|
|
|
|
add_foreign_key :ticket_articles, :users, column: :updated_by_id
|
|
|
|
add_foreign_key :ticket_articles, :users, column: :origin_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :ticket_article_flags do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :ticket_article, null: false
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :key, :string, limit: 50, null: false
|
|
|
|
t.column :value, :string, limit: 50, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :created_by_id, :integer, null: false
|
2020-06-22 09:57:45 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2017-11-23 08:09:44 +00:00
|
|
|
add_index :ticket_article_flags, %i[ticket_article_id created_by_id], name: 'index_ticket_article_flags_on_articles_id_and_created_by_id'
|
|
|
|
add_index :ticket_article_flags, %i[ticket_article_id key]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_index :ticket_article_flags, [:ticket_article_id]
|
2012-04-10 14:06:46 +00:00
|
|
|
add_index :ticket_article_flags, [:created_by_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :ticket_article_flags, :ticket_articles, column: :ticket_article_id
|
|
|
|
add_foreign_key :ticket_article_flags, :users, column: :created_by_id
|
|
|
|
|
|
|
|
create_table :ticket_time_accountings do |t|
|
|
|
|
t.references :ticket, null: false
|
|
|
|
t.references :ticket_article, null: true
|
|
|
|
t.column :time_unit, :decimal, precision: 6, scale: 2, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
|
|
|
t.timestamps limit: 3, null: false
|
|
|
|
end
|
|
|
|
add_index :ticket_time_accountings, [:ticket_id]
|
|
|
|
add_index :ticket_time_accountings, [:ticket_article_id]
|
|
|
|
add_index :ticket_time_accountings, [:created_by_id]
|
|
|
|
add_index :ticket_time_accountings, [:time_unit]
|
|
|
|
add_foreign_key :ticket_time_accountings, :tickets
|
|
|
|
add_foreign_key :ticket_time_accountings, :ticket_articles
|
|
|
|
add_foreign_key :ticket_time_accountings, :users, column: :created_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
2012-12-02 21:59:13 +00:00
|
|
|
create_table :ticket_counters do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :content, :string, limit: 100, null: false
|
|
|
|
t.column :generator, :string, limit: 100, null: false
|
2012-12-02 21:59:13 +00:00
|
|
|
end
|
2015-04-27 13:42:53 +00:00
|
|
|
add_index :ticket_counters, [:generator], unique: true
|
2012-12-02 21:59:13 +00:00
|
|
|
|
2012-04-10 14:06:46 +00:00
|
|
|
create_table :overviews do |t|
|
2016-11-17 08:56:43 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :link, :string, limit: 250, null: false
|
|
|
|
t.column :prio, :integer, null: false
|
|
|
|
t.column :condition, :text, limit: 500.kilobytes + 1, null: false
|
|
|
|
t.column :order, :string, limit: 2500, null: false
|
|
|
|
t.column :group_by, :string, limit: 250, null: true
|
2018-07-12 07:18:39 +00:00
|
|
|
t.column :group_direction, :string, limit: 250, null: true
|
2016-11-17 08:56:43 +00:00
|
|
|
t.column :organization_shared, :boolean, null: false, default: false
|
2017-09-05 09:49:32 +00:00
|
|
|
t.column :out_of_office, :boolean, null: false, default: false
|
2020-06-22 09:57:45 +00:00
|
|
|
t.column :view, :string, limit: 1000, null: false
|
2016-11-17 08:56:43 +00:00
|
|
|
t.column :active, :boolean, null: false, default: true
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
|
|
|
add_index :overviews, [:name]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :overviews, :users, column: :created_by_id
|
|
|
|
add_foreign_key :overviews, :users, column: :updated_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
2017-04-19 19:54:04 +00:00
|
|
|
create_table :overviews_roles, id: false do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :overview
|
|
|
|
t.references :role
|
2017-04-19 19:54:04 +00:00
|
|
|
end
|
|
|
|
add_index :overviews_roles, [:overview_id]
|
|
|
|
add_index :overviews_roles, [:role_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :overviews_roles, :overviews
|
|
|
|
add_foreign_key :overviews_roles, :roles
|
2017-04-19 19:54:04 +00:00
|
|
|
|
2016-03-18 02:04:49 +00:00
|
|
|
create_table :overviews_users, id: false do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :overview
|
|
|
|
t.references :user
|
2016-03-18 02:04:49 +00:00
|
|
|
end
|
|
|
|
add_index :overviews_users, [:overview_id]
|
|
|
|
add_index :overviews_users, [:user_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :overviews_users, :overviews
|
|
|
|
add_foreign_key :overviews_users, :users
|
2016-03-18 02:04:49 +00:00
|
|
|
|
2015-04-27 13:42:53 +00:00
|
|
|
create_table :overviews_groups, id: false do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :overview
|
|
|
|
t.references :group
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
|
|
|
add_index :overviews_groups, [:overview_id]
|
|
|
|
add_index :overviews_groups, [:group_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :overviews_groups, :overviews
|
|
|
|
add_foreign_key :overviews_groups, :groups
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :triggers do |t|
|
2020-06-22 09:57:45 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
2016-11-17 08:56:43 +00:00
|
|
|
t.column :condition, :text, limit: 500.kilobytes + 1, null: false
|
|
|
|
t.column :perform, :text, limit: 500.kilobytes + 1, null: false
|
|
|
|
t.column :disable_notification, :boolean, null: false, default: true
|
|
|
|
t.column :note, :string, limit: 250, null: true
|
|
|
|
t.column :active, :boolean, null: false, default: true
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2016-03-18 02:04:49 +00:00
|
|
|
end
|
|
|
|
add_index :triggers, [:name], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :triggers, :users, column: :created_by_id
|
|
|
|
add_foreign_key :triggers, :users, column: :updated_by_id
|
2016-03-18 02:04:49 +00:00
|
|
|
|
|
|
|
create_table :jobs do |t|
|
2016-11-17 08:56:43 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :timeplan, :string, limit: 2500, null: false
|
|
|
|
t.column :condition, :text, limit: 500.kilobytes + 1, null: false
|
|
|
|
t.column :perform, :text, limit: 500.kilobytes + 1, null: false
|
|
|
|
t.column :disable_notification, :boolean, null: false, default: true
|
|
|
|
t.column :last_run_at, :timestamp, limit: 3, null: true
|
|
|
|
t.column :next_run_at, :timestamp, limit: 3, null: true
|
|
|
|
t.column :running, :boolean, null: false, default: false
|
|
|
|
t.column :processed, :integer, null: false, default: 0
|
|
|
|
t.column :matching, :integer, null: false
|
|
|
|
t.column :pid, :string, limit: 250, null: true
|
|
|
|
t.column :note, :string, limit: 250, null: true
|
|
|
|
t.column :active, :boolean, null: false, default: false
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2016-03-18 02:04:49 +00:00
|
|
|
add_index :jobs, [:name], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :jobs, :users, column: :created_by_id
|
|
|
|
add_foreign_key :jobs, :users, column: :updated_by_id
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :notifications do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :subject, :string, limit: 250, null: false
|
|
|
|
t.column :body, :string, limit: 8000, null: false
|
|
|
|
t.column :content_type, :string, limit: 250, null: false
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :active, :boolean, null: false, default: true
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :note, :string, limit: 250, null: true
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table :link_types do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :note, :string, limit: 250, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :active, :boolean, null: false, default: true
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2017-06-06 15:49:49 +00:00
|
|
|
add_index :link_types, [:name], unique: true
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :link_objects do |t|
|
2015-04-27 13:42:53 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :note, :string, limit: 250, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :active, :boolean, null: false, default: true
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2020-06-22 09:57:45 +00:00
|
|
|
add_index :link_objects, [:name], unique: true
|
2012-04-10 14:06:46 +00:00
|
|
|
|
|
|
|
create_table :links do |t|
|
2015-09-27 21:34:21 +00:00
|
|
|
t.references :link_type, null: false
|
|
|
|
t.column :link_object_source_id, :integer, null: false
|
|
|
|
t.column :link_object_source_value, :integer, null: false
|
|
|
|
t.column :link_object_target_id, :integer, null: false
|
|
|
|
t.column :link_object_target_value, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
2017-11-23 08:09:44 +00:00
|
|
|
add_index :links, %i[link_object_source_id link_object_source_value link_object_target_id link_object_target_value link_type_id], unique: true, name: 'links_uniq_total'
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :links, :link_types
|
2015-07-01 01:08:01 +00:00
|
|
|
|
|
|
|
create_table :postmaster_filters do |t|
|
2016-11-17 08:56:43 +00:00
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :channel, :string, limit: 250, null: false
|
|
|
|
t.column :match, :text, limit: 500.kilobytes + 1, null: false
|
|
|
|
t.column :perform, :text, limit: 500.kilobytes + 1, null: false
|
|
|
|
t.column :active, :boolean, null: false, default: true
|
|
|
|
t.column :note, :string, limit: 250, null: true
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2015-07-01 01:08:01 +00:00
|
|
|
end
|
|
|
|
add_index :postmaster_filters, [:channel]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :postmaster_filters, :users, column: :created_by_id
|
|
|
|
add_foreign_key :postmaster_filters, :users, column: :updated_by_id
|
2015-07-01 01:08:01 +00:00
|
|
|
|
|
|
|
create_table :text_modules do |t|
|
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :keywords, :string, limit: 500, null: true
|
2016-05-09 14:55:31 +00:00
|
|
|
t.column :content, :text, limit: 10.megabytes + 1, null: false
|
2015-07-01 01:08:01 +00:00
|
|
|
t.column :note, :string, limit: 250, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :active, :boolean, null: false, default: true
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2015-07-01 01:08:01 +00:00
|
|
|
end
|
|
|
|
add_index :text_modules, [:name]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :text_modules, :users, column: :created_by_id
|
|
|
|
add_foreign_key :text_modules, :users, column: :updated_by_id
|
2015-07-01 01:08:01 +00:00
|
|
|
|
|
|
|
create_table :text_modules_groups, id: false do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :text_module
|
|
|
|
t.references :group
|
2015-07-01 01:08:01 +00:00
|
|
|
end
|
|
|
|
add_index :text_modules_groups, [:text_module_id]
|
|
|
|
add_index :text_modules_groups, [:group_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :text_modules_groups, :text_modules
|
|
|
|
add_foreign_key :text_modules_groups, :groups
|
2015-07-01 01:08:01 +00:00
|
|
|
|
|
|
|
create_table :templates do |t|
|
|
|
|
t.column :name, :string, limit: 250, null: false
|
2016-09-21 17:38:32 +00:00
|
|
|
t.column :options, :text, limit: 10.megabytes + 1, null: false
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2015-07-01 01:08:01 +00:00
|
|
|
end
|
|
|
|
add_index :templates, [:name]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :templates, :users, column: :created_by_id
|
|
|
|
add_foreign_key :templates, :users, column: :updated_by_id
|
2015-07-01 01:08:01 +00:00
|
|
|
|
|
|
|
create_table :templates_groups, id: false do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :template
|
|
|
|
t.references :group
|
2015-07-01 01:08:01 +00:00
|
|
|
end
|
|
|
|
add_index :templates_groups, [:template_id]
|
|
|
|
add_index :templates_groups, [:group_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :templates_groups, :templates
|
|
|
|
add_foreign_key :templates_groups, :groups
|
2015-07-01 01:08:01 +00:00
|
|
|
|
2015-07-01 08:50:42 +00:00
|
|
|
create_table :channels do |t|
|
2015-09-27 21:34:21 +00:00
|
|
|
t.references :group, null: true
|
2015-07-01 08:50:42 +00:00
|
|
|
t.column :area, :string, limit: 100, null: false
|
2016-07-18 08:03:46 +00:00
|
|
|
t.column :options, :text, limit: 500.kilobytes + 1, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :active, :boolean, null: false, default: true
|
2016-09-12 06:56:14 +00:00
|
|
|
t.column :preferences, :string, limit: 2000, null: true
|
2016-05-20 10:21:55 +00:00
|
|
|
t.column :last_log_in, :text, limit: 500.kilobytes + 1, null: true
|
|
|
|
t.column :last_log_out, :text, limit: 500.kilobytes + 1, null: true
|
2016-09-12 06:56:14 +00:00
|
|
|
t.column :status_in, :string, limit: 100, null: true
|
|
|
|
t.column :status_out, :string, limit: 100, null: true
|
2015-09-27 21:34:21 +00:00
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2015-07-01 08:50:42 +00:00
|
|
|
end
|
|
|
|
add_index :channels, [:area]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :channels, :groups
|
|
|
|
add_foreign_key :channels, :users, column: :created_by_id
|
|
|
|
add_foreign_key :channels, :users, column: :updated_by_id
|
2015-07-01 08:50:42 +00:00
|
|
|
|
|
|
|
create_table :slas do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :calendar, null: false
|
2015-09-26 11:32:33 +00:00
|
|
|
t.column :name, :string, limit: 150, null: true
|
2015-07-01 08:50:42 +00:00
|
|
|
t.column :first_response_time, :integer, null: true
|
2021-10-27 09:38:45 +00:00
|
|
|
t.column :response_time, :integer, null: true
|
2015-07-01 08:50:42 +00:00
|
|
|
t.column :update_time, :integer, null: true
|
2016-05-20 10:21:55 +00:00
|
|
|
t.column :solution_time, :integer, null: true
|
2016-11-17 08:56:43 +00:00
|
|
|
t.column :condition, :text, limit: 500.kilobytes + 1, null: true
|
2015-07-01 08:50:42 +00:00
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2015-07-01 08:50:42 +00:00
|
|
|
end
|
|
|
|
add_index :slas, [:name], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :slas, :users, column: :created_by_id
|
|
|
|
add_foreign_key :slas, :users, column: :updated_by_id
|
2015-07-01 08:50:42 +00:00
|
|
|
|
2016-05-20 10:21:55 +00:00
|
|
|
create_table :macros do |t|
|
2020-06-22 09:57:45 +00:00
|
|
|
t.string :name, limit: 250, null: true
|
2016-11-17 08:56:43 +00:00
|
|
|
t.text :perform, limit: 500.kilobytes + 1, null: false
|
|
|
|
t.boolean :active, null: false, default: true
|
2018-06-22 11:17:12 +00:00
|
|
|
t.string :ux_flow_next_up, null: false, default: 'none'
|
2020-06-22 09:57:45 +00:00
|
|
|
t.string :note, limit: 250, null: true
|
2016-11-17 08:56:43 +00:00
|
|
|
t.integer :updated_by_id, null: false
|
|
|
|
t.integer :created_by_id, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2016-05-20 10:21:55 +00:00
|
|
|
end
|
|
|
|
add_index :macros, [:name], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :macros, :users, column: :created_by_id
|
|
|
|
add_foreign_key :macros, :users, column: :updated_by_id
|
2016-05-20 10:21:55 +00:00
|
|
|
|
|
|
|
create_table :chats do |t|
|
2020-06-22 09:57:45 +00:00
|
|
|
t.string :name, limit: 250, null: true
|
|
|
|
t.integer :max_queue, null: false, default: 5
|
|
|
|
t.string :note, limit: 250, null: true
|
2016-05-20 10:21:55 +00:00
|
|
|
t.boolean :active, null: false, default: true
|
|
|
|
t.boolean :public, null: false, default: false
|
2018-01-28 23:52:02 +00:00
|
|
|
t.string :block_ip, limit: 5000, null: true
|
|
|
|
t.string :block_country, limit: 5000, null: true
|
2021-07-12 13:18:31 +00:00
|
|
|
t.string :allowed_websites, limit: 5000, null: true
|
2016-05-20 10:21:55 +00:00
|
|
|
t.string :preferences, limit: 5000, null: true
|
|
|
|
t.integer :updated_by_id, null: false
|
|
|
|
t.integer :created_by_id, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2016-05-20 10:21:55 +00:00
|
|
|
end
|
|
|
|
add_index :chats, [:name], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :chats, :users, column: :created_by_id
|
|
|
|
add_foreign_key :chats, :users, column: :updated_by_id
|
2016-05-20 10:21:55 +00:00
|
|
|
|
|
|
|
create_table :chat_sessions do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :chat, null: false
|
2016-05-20 10:21:55 +00:00
|
|
|
t.string :session_id, null: false
|
|
|
|
t.string :name, limit: 250, null: true
|
|
|
|
t.string :state, limit: 50, null: false, default: 'waiting' # running, closed
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :user, null: true
|
2020-06-22 09:57:45 +00:00
|
|
|
t.text :preferences, limit: 100.kilobytes + 1, null: true
|
2016-05-20 10:21:55 +00:00
|
|
|
t.integer :updated_by_id, null: true
|
|
|
|
t.integer :created_by_id, null: true
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2016-05-20 10:21:55 +00:00
|
|
|
end
|
|
|
|
add_index :chat_sessions, [:session_id]
|
|
|
|
add_index :chat_sessions, [:state]
|
|
|
|
add_index :chat_sessions, [:user_id]
|
|
|
|
add_index :chat_sessions, [:chat_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :chat_sessions, :chats
|
|
|
|
add_foreign_key :chat_sessions, :users
|
|
|
|
add_foreign_key :chat_sessions, :users, column: :created_by_id
|
|
|
|
add_foreign_key :chat_sessions, :users, column: :updated_by_id
|
2016-05-20 10:21:55 +00:00
|
|
|
|
|
|
|
create_table :chat_messages do |t|
|
2020-06-22 09:57:45 +00:00
|
|
|
t.references :chat_session, null: false
|
|
|
|
t.text :content, limit: 20.megabytes + 1, null: false
|
|
|
|
t.integer :created_by_id, null: true
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2016-05-20 10:21:55 +00:00
|
|
|
end
|
|
|
|
add_index :chat_messages, [:chat_session_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :chat_messages, :chat_sessions
|
|
|
|
add_foreign_key :chat_messages, :users, column: :created_by_id
|
2016-05-20 10:21:55 +00:00
|
|
|
|
|
|
|
create_table :chat_agents do |t|
|
|
|
|
t.boolean :active, null: false, default: true
|
|
|
|
t.integer :concurrent, null: false, default: 5
|
|
|
|
t.integer :updated_by_id, null: false
|
|
|
|
t.integer :created_by_id, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2016-05-20 10:21:55 +00:00
|
|
|
end
|
|
|
|
add_index :chat_agents, [:active]
|
|
|
|
add_index :chat_agents, [:updated_by_id], unique: true
|
|
|
|
add_index :chat_agents, [:created_by_id], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :chat_agents, :users, column: :created_by_id
|
|
|
|
add_foreign_key :chat_agents, :users, column: :updated_by_id
|
2016-05-20 10:21:55 +00:00
|
|
|
|
|
|
|
create_table :report_profiles do |t|
|
2020-06-22 09:57:45 +00:00
|
|
|
t.column :name, :string, limit: 150, null: true
|
2016-11-17 08:56:43 +00:00
|
|
|
t.column :condition, :text, limit: 500.kilobytes + 1, null: true
|
|
|
|
t.column :active, :boolean, null: false, default: true
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
2016-09-12 06:56:14 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
2016-05-20 10:21:55 +00:00
|
|
|
end
|
|
|
|
add_index :report_profiles, [:name], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :report_profiles, :users, column: :created_by_id
|
|
|
|
add_foreign_key :report_profiles, :users, column: :updated_by_id
|
2016-05-20 10:21:55 +00:00
|
|
|
|
2016-10-19 03:20:00 +00:00
|
|
|
create_table :karma_users do |t|
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :user, null: false
|
2016-10-19 03:20:00 +00:00
|
|
|
t.integer :score, null: false
|
2020-06-22 09:57:45 +00:00
|
|
|
t.string :level, limit: 200, null: false
|
2016-10-19 03:20:00 +00:00
|
|
|
t.timestamps limit: 3, null: false
|
|
|
|
end
|
|
|
|
add_index :karma_users, [:user_id], unique: true
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :karma_users, :users
|
2016-10-19 03:20:00 +00:00
|
|
|
|
|
|
|
create_table :karma_activities do |t|
|
|
|
|
t.string :name, limit: 200, null: false
|
|
|
|
t.string :description, limit: 200, null: false
|
|
|
|
t.integer :score, null: false
|
|
|
|
t.integer :once_ttl, null: false
|
|
|
|
t.timestamps limit: 3, null: false
|
|
|
|
end
|
|
|
|
add_index :karma_activities, [:name], unique: true
|
|
|
|
|
|
|
|
create_table :karma_activity_logs do |t|
|
|
|
|
t.integer :o_id, null: false
|
|
|
|
t.integer :object_lookup_id, null: false
|
2017-06-06 15:49:49 +00:00
|
|
|
t.references :user, null: false
|
2016-10-19 03:20:00 +00:00
|
|
|
t.integer :activity_id, null: false
|
|
|
|
t.integer :score, null: false
|
|
|
|
t.integer :score_total, null: false
|
|
|
|
t.timestamps limit: 3, null: false
|
|
|
|
end
|
|
|
|
add_index :karma_activity_logs, [:user_id]
|
|
|
|
add_index :karma_activity_logs, [:created_at]
|
2017-11-23 08:09:44 +00:00
|
|
|
add_index :karma_activity_logs, %i[o_id object_lookup_id]
|
2017-06-06 15:49:49 +00:00
|
|
|
add_foreign_key :karma_activity_logs, :users
|
|
|
|
add_foreign_key :karma_activity_logs, :karma_activities, column: :activity_id
|
2021-02-23 14:52:16 +00:00
|
|
|
|
|
|
|
create_table :webhooks do |t|
|
|
|
|
t.column :name, :string, limit: 250, null: false
|
|
|
|
t.column :endpoint, :string, limit: 300, null: false
|
|
|
|
t.column :signature_token, :string, limit: 200, null: true
|
|
|
|
t.column :ssl_verify, :boolean, null: false, default: true
|
|
|
|
t.column :note, :string, limit: 500, null: true
|
|
|
|
t.column :active, :boolean, null: false, default: true
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
|
|
|
t.column :created_by_id, :integer, null: false
|
|
|
|
t.timestamps limit: 3, null: false
|
|
|
|
end
|
|
|
|
|
2022-02-24 11:33:52 +00:00
|
|
|
create_table :ticket_shared_draft_zooms do |t|
|
|
|
|
t.references :ticket, null: false, foreign_key: { to_table: :tickets }
|
|
|
|
t.text :new_article
|
|
|
|
t.text :ticket_attributes
|
2022-03-02 12:55:30 +00:00
|
|
|
t.column :created_by_id, :integer, null: false
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
2022-02-24 11:33:52 +00:00
|
|
|
t.timestamps limit: 3
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table :ticket_shared_draft_starts do |t|
|
|
|
|
t.references :group, null: false, foreign_key: { to_table: :groups }
|
|
|
|
t.string :name
|
|
|
|
t.text :content
|
2022-03-02 12:55:30 +00:00
|
|
|
t.column :created_by_id, :integer, null: false
|
|
|
|
t.column :updated_by_id, :integer, null: false
|
2022-02-24 11:33:52 +00:00
|
|
|
t.timestamps limit: 3
|
|
|
|
end
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
2016-10-19 03:20:00 +00:00
|
|
|
drop_table :karma_activity_logs
|
|
|
|
drop_table :karma_activities
|
|
|
|
drop_table :karma_users
|
2016-05-20 10:21:55 +00:00
|
|
|
drop_table :report_profiles
|
|
|
|
drop_table :chat_sessions
|
|
|
|
drop_table :chat_messages
|
|
|
|
drop_table :chat_agents
|
|
|
|
drop_table :chats
|
|
|
|
drop_table :macros
|
2015-07-01 08:50:42 +00:00
|
|
|
drop_table :slas
|
|
|
|
drop_table :channels
|
2015-07-01 01:08:01 +00:00
|
|
|
drop_table :templates_groups
|
|
|
|
drop_table :templates
|
|
|
|
drop_table :text_modules_groups
|
|
|
|
drop_table :text_modules
|
|
|
|
drop_table :postmaster_filters
|
2012-04-10 14:06:46 +00:00
|
|
|
drop_table :notifications
|
|
|
|
drop_table :triggers
|
|
|
|
drop_table :links
|
|
|
|
drop_table :link_types
|
|
|
|
drop_table :link_objects
|
|
|
|
drop_table :overviews
|
2012-12-02 21:59:13 +00:00
|
|
|
drop_table :ticket_counters
|
2012-04-10 14:06:46 +00:00
|
|
|
drop_table :ticket_time_accounting
|
|
|
|
drop_table :ticket_article_flags
|
|
|
|
drop_table :ticket_articles
|
|
|
|
drop_table :ticket_article_types
|
|
|
|
drop_table :ticket_article_senders
|
|
|
|
drop_table :ticket_flags
|
|
|
|
drop_table :tickets
|
|
|
|
drop_table :ticket_priorities
|
|
|
|
drop_table :ticket_states
|
|
|
|
drop_table :ticket_state_types
|
2021-02-23 14:52:16 +00:00
|
|
|
drop_table :webhooks
|
2022-02-24 11:33:52 +00:00
|
|
|
drop_table :ticket_shared_draft_zooms
|
|
|
|
drop_table :ticket_shared_draft_starts
|
2012-04-10 14:06:46 +00:00
|
|
|
end
|
|
|
|
end
|