Initial Redmine tooling and local plugin forks
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateContacts < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
create_table :contacts do |t|
|
||||
t.string :first_name
|
||||
t.string :last_name
|
||||
t.string :middle_name
|
||||
t.string :company
|
||||
t.text :address
|
||||
t.string :phone
|
||||
t.string :email
|
||||
t.string :website
|
||||
t.string :skype_name
|
||||
t.date :birthday
|
||||
t.string :avatar
|
||||
t.text :background
|
||||
t.string :job_title
|
||||
t.boolean :is_company, :default => false
|
||||
t.integer :author_id, :default => 0, :null => false
|
||||
t.integer :assigned_to_id
|
||||
t.datetime :created_on
|
||||
t.datetime :updated_on
|
||||
end
|
||||
|
||||
add_index :contacts, :author_id
|
||||
add_index :contacts, :company
|
||||
add_index :contacts, :is_company
|
||||
add_index :contacts, :email
|
||||
add_index :contacts, :first_name
|
||||
add_index :contacts, :assigned_to_id
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :contacts
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,50 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateContactsRelations < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
create_table :contacts_deals, :id => false do |t|
|
||||
t.integer :deal_id
|
||||
t.integer :contact_id
|
||||
end
|
||||
add_index :contacts_deals, :deal_id
|
||||
add_index :contacts_deals, :contact_id
|
||||
|
||||
create_table :contacts_issues, :id => false do |t|
|
||||
t.integer :issue_id, :default => 0, :null => false
|
||||
t.integer :contact_id, :default => 0, :null => false
|
||||
end
|
||||
add_index :contacts_issues, :issue_id
|
||||
add_index :contacts_issues, :contact_id
|
||||
|
||||
create_table :contacts_projects, :id => false do |t|
|
||||
t.integer :project_id, :default => 0, :null => false
|
||||
t.integer :contact_id, :default => 0, :null => false
|
||||
end
|
||||
add_index :contacts_projects, :project_id
|
||||
add_index :contacts_projects, :contact_id
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :contacts_deals
|
||||
drop_table :contacts_issues
|
||||
drop_table :contacts_projects
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,49 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateDeals < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
create_table :deals do |t|
|
||||
t.string :name
|
||||
t.text :background
|
||||
t.integer :currency
|
||||
t.integer :duration
|
||||
t.decimal :price, :precision => 10, :scale => 2
|
||||
t.integer :price_type
|
||||
t.integer :project_id
|
||||
t.integer :author_id
|
||||
t.integer :assigned_to_id
|
||||
t.integer :status_id
|
||||
t.integer :contact_id
|
||||
t.integer :category_id
|
||||
t.datetime :created_on
|
||||
t.datetime :updated_on
|
||||
end
|
||||
add_index :deals, :contact_id
|
||||
add_index :deals, :project_id
|
||||
add_index :deals, :status_id
|
||||
add_index :deals, :author_id
|
||||
add_index :deals, :category_id
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :deals
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,61 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateDealsRelations < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
create_table :deal_categories do |t|
|
||||
t.string :name, :null => false
|
||||
t.integer :project_id
|
||||
end
|
||||
add_index :deal_categories, :project_id
|
||||
|
||||
create_table :deal_processes do |t|
|
||||
t.integer :deal_id, :null => false
|
||||
t.integer :author_id, :null => false
|
||||
t.integer :old_value
|
||||
t.integer :value, :null => false
|
||||
t.datetime :created_at
|
||||
end
|
||||
add_index :deal_processes, [:author_id]
|
||||
add_index :deal_processes, [:deal_id]
|
||||
|
||||
create_table :deal_statuses do |t|
|
||||
t.string :name, :null => false
|
||||
t.integer :position
|
||||
t.boolean :is_default, :default => false, :null => false
|
||||
t.boolean :is_closed, :default => false, :null => false
|
||||
t.integer :color, :default => 11184810, :null => false
|
||||
end
|
||||
add_index :deal_statuses, [:is_closed]
|
||||
|
||||
create_table :deal_statuses_projects, :id => false do |t|
|
||||
t.integer :project_id, :default => 0, :null => false
|
||||
t.integer :deal_status_id, :default => 0, :null => false
|
||||
end
|
||||
add_index :deal_statuses_projects, [:project_id, :deal_status_id]
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :deal_categories
|
||||
drop_table :deal_processes
|
||||
drop_table :deal_statuses
|
||||
drop_table :deal_statuses_projects
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,39 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateNotes < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
create_table :notes do |t|
|
||||
t.string :subject
|
||||
t.text :content
|
||||
t.integer :source_id
|
||||
t.string :source_type
|
||||
t.integer :author_id
|
||||
t.datetime :created_on
|
||||
t.datetime :updated_on
|
||||
end
|
||||
add_index :notes, [:source_id, :source_type]
|
||||
add_index :notes, [:author_id]
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :notes
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,30 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateTags < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
# unless table_exists?(:viewings)
|
||||
ActiveRecord::Base.create_taggable_table
|
||||
# end
|
||||
end
|
||||
|
||||
def self.down
|
||||
ActiveRecord::Base.drop_taggable_table
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,37 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateRecentlyVieweds < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
create_table :recently_vieweds do |t|
|
||||
t.references :viewer
|
||||
t.references :viewed, :polymorphic => true
|
||||
t.column :views_count, :integer
|
||||
t.timestamps :null => false
|
||||
end
|
||||
|
||||
add_index :recently_vieweds, [:viewed_id, :viewed_type]
|
||||
add_index :recently_vieweds, :viewer_id
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :recently_vieweds
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,34 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateContactsSettings < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
create_table :contacts_settings do |t|
|
||||
t.column :name, :string
|
||||
t.column :value, :text
|
||||
t.column :project_id, :integer
|
||||
t.column :updated_on, :datetime
|
||||
end
|
||||
add_index :contacts_settings, :project_id
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :contacts_settings
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,29 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class AddTypeToNotes < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
add_column :notes, :type_id, :integer
|
||||
add_index :notes, :type_id
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :notes, :type_id
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,32 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class AddFieldsToDeals < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
change_column :deals, :duration, :integer, :default => 1
|
||||
add_column :deals, :due_date, :timestamp
|
||||
add_column :deals, :probability, :integer
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :deals, :due_date
|
||||
remove_column :deals, :probability
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,42 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateContactsQueries < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
create_table :contacts_queries do |t|
|
||||
t.integer :project_id
|
||||
t.string :name, :default => "", :null => false
|
||||
t.text :filters
|
||||
t.integer :user_id, :default => 0, :null => false
|
||||
t.boolean :is_public, :default => false, :null => false
|
||||
t.text :column_names
|
||||
t.text :sort_criteria
|
||||
t.string :group_by
|
||||
t.string :type
|
||||
end
|
||||
add_index :contacts_queries, :project_id
|
||||
add_index :contacts_queries, :user_id
|
||||
|
||||
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :contacts_queries
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,27 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class ChangeDealsCurrencyType < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
change_column :deals, :currency, :string
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,29 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class AddCachedTagListToContacts < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :contacts, :cached_tag_list, :string
|
||||
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :contacts, :cached_tag_list
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,38 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class AddVisibilityToContacts < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :contacts, :visibility, :integer, :default => Contact::VISIBILITY_PROJECT, :null => false
|
||||
|
||||
Contact.find_each(:batch_size => 1000) do |contact|
|
||||
contact.tag_list
|
||||
contact.save
|
||||
end
|
||||
|
||||
ContactsSetting.all.each do |setting|
|
||||
setting.value = YAML::load(setting.value.respond_to?(:force_encoding) ? setting.value.force_encoding('utf-8') : setting.value) if setting.value.is_a?(String) rescue ''
|
||||
setting.save!
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :contacts, :visibility
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,30 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class ChangeDealStatusesIsClosed < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_column :deal_statuses, :is_closed
|
||||
add_column :deal_statuses, :status_type, :integer, :default => 0, :null => false
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :deal_statuses, :status_type
|
||||
add_column :deal_statuses, :is_closed, :boolean, :default => false, :null => false
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,30 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class PopulateContactsModule < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
EnabledModule.where(:name => 'contacts_module').update_all(:name => 'contacts')
|
||||
EnabledModule.where(:name => 'contacts').select(:project_id).map(&:project_id).each{|p| EnabledModule.create(:project_id => p, :name => "deals")}
|
||||
end
|
||||
|
||||
def down
|
||||
EnabledModule.where(:name => 'contacts').update_all(:name => 'contacts_module')
|
||||
EnabledModule.where(:name => 'deals').delete_all
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,49 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateAddresses < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
create_table :addresses do |t|
|
||||
t.string :street1
|
||||
t.string :street2
|
||||
t.string :city
|
||||
t.string :region
|
||||
t.string :postcode
|
||||
t.string :country_code, :limit => 2
|
||||
t.text :full_address
|
||||
t.string :address_type, :limit => 16
|
||||
t.references :addressable, :polymorphic => true
|
||||
t.timestamps :null => false
|
||||
end
|
||||
add_index :addresses, [ :addressable_id, :addressable_type ]
|
||||
add_index :addresses, :address_type
|
||||
|
||||
Contact.all.each do |asset|
|
||||
Address.create(:street1 => asset.attributes["address"].gsub(/\n/, ' ').first(250), :full_address => asset.attributes["address"], :address_type => "business", :addressable => asset) unless asset.attributes["address"].blank?
|
||||
end
|
||||
|
||||
remove_column(:contacts, :address)
|
||||
end
|
||||
|
||||
def down
|
||||
add_column :contacts, :address, :text
|
||||
drop_table :addresses
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,31 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class CreateDealsIssues < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :deals_issues do |t|
|
||||
t.integer :issue_id, :default => 0, :null => false
|
||||
t.integer :deal_id, :default => 0, :null => false
|
||||
end
|
||||
add_index :deals_issues, :issue_id
|
||||
add_index :deals_issues, :deal_id
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# This file is a part of Redmine CRM (redmine_contacts) plugin,
|
||||
# customer relationship management plugin for Redmine
|
||||
#
|
||||
# Copyright (C) 2010-2018 RedmineUP
|
||||
# http://www.redmineup.com/
|
||||
#
|
||||
# redmine_contacts is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# redmine_contacts is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with redmine_contacts. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class ChangeDealsPricePrecision < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
change_column :deals, :price, :decimal, :precision => 20, :scale => 2
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user