Initial Redmine tooling and local plugin forks
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
class CreateContactJournals < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :contact_journals do |t|
|
||||
t.references :contact
|
||||
t.references :journal
|
||||
t.string :email
|
||||
t.boolean :is_incoming
|
||||
t.timestamps :null => false
|
||||
end
|
||||
add_index :contact_journals, [:journal_id, :contact_id]
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :contact_journals
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
class CreateHelpdeskTickets < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :helpdesk_tickets do |t|
|
||||
t.references :contact
|
||||
t.references :issue
|
||||
t.integer :source, :null => false, :default => HelpdeskTicket::HELPDESK_EMAIL_SOURCE
|
||||
t.string :from_address
|
||||
t.string :to_address
|
||||
t.datetime :ticket_date
|
||||
end
|
||||
add_index :helpdesk_tickets, [:issue_id, :contact_id]
|
||||
|
||||
remove_index :contact_journals, [:journal_id, :contact_id]
|
||||
rename_table :contact_journals, :journal_messages
|
||||
add_index :journal_messages, [:journal_id, :contact_id]
|
||||
|
||||
change_table :journal_messages do |t|
|
||||
t.remove :created_at, :updated_at
|
||||
t.integer :source, :null => false, :default => HelpdeskTicket::HELPDESK_EMAIL_SOURCE
|
||||
t.string :from_address
|
||||
t.string :to_address
|
||||
t.string :bcc_address
|
||||
t.string :cc_address
|
||||
t.datetime :message_date
|
||||
end
|
||||
|
||||
JournalMessage.where(:is_incoming => true).update_all("from_address = email")
|
||||
JournalMessage.where(:is_incoming => false).update_all("to_address = email")
|
||||
|
||||
remove_column :journal_messages, :email
|
||||
Attachment.where(:container_type => 'ContactJournal').update_all(:container_type => 'JournalMessage')
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
Attachment.where(:container_type => 'JournalMessage').update_all(:container_type => 'ContactJournal')
|
||||
drop_table :helpdesk_tickets
|
||||
add_column :journal_messages, :email, :string
|
||||
|
||||
JournalMessage.where(:is_incoming => true).update_all("email = from_address")
|
||||
JournalMessage.where(:is_incoming => false).update_all("email = to_address")
|
||||
|
||||
change_table :journal_messages do |t|
|
||||
t.timestamps
|
||||
t.remove :source, :from_address, :to_address, :bcc_address, :cc_address, :message_date
|
||||
end
|
||||
|
||||
rename_table :journal_messages, :contact_journals
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class AddCcAndMessageIdToHelpdeskTickets < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :helpdesk_tickets, :cc_address, :string
|
||||
add_column :helpdesk_tickets, :message_id, :string
|
||||
add_index :helpdesk_tickets, [:message_id]
|
||||
|
||||
add_column :journal_messages, :message_id, :string
|
||||
add_index :journal_messages, [:message_id]
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
class CreateCannedResponses < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :canned_responses do |t|
|
||||
t.string :name
|
||||
t.text :content
|
||||
t.integer :project_id
|
||||
t.integer :user_id
|
||||
t.boolean :is_public
|
||||
end
|
||||
end
|
||||
end
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class AddIsIncomingToHelpdeskTickets < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :helpdesk_tickets, :is_incoming, :boolean, :default => true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddMetricsToHelpdeskTickets < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :helpdesk_tickets, :reaction_time, :integer
|
||||
add_column :helpdesk_tickets, :first_response_time, :integer
|
||||
add_column :helpdesk_tickets, :resolve_time, :integer
|
||||
add_column :helpdesk_tickets, :last_agent_response_at, :datetime
|
||||
add_column :helpdesk_tickets, :last_customer_response_at, :datetime
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class PopulateHelpdeskTicketsMetrics < ActiveRecord::Migration
|
||||
def up
|
||||
HelpdeskTicket.joins(:issue).readonly(false).each(&:save)
|
||||
end
|
||||
|
||||
def down
|
||||
#none
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class AddVoteToHelpdeskTickets < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :helpdesk_tickets, :vote, :integer, :default => nil
|
||||
add_column :helpdesk_tickets, :vote_comment, :string
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user