[#4184] Added check to make sure the budget plugin is not installed.

This commit is contained in:
Eric Davis committed 2010-07-14 10:58:08 -07:00
1 parent 7d9f45d2ed
commit ad4b3e542b
2 files changed
+25 -1

No files matched your search

@@ -1,7 +1,8 @@
require 'pp' require 'pp'
module RedmineContracts module RedmineContracts
class BudgetPluginInstalledError < StandardError; end
# TODO: decide how this is activated. # TODO: decide how this is activated.
# Have the user dump yaml themselves? Or rename the tables and # Have the user dump yaml themselves? Or rename the tables and
# SQL select the data out into yaml? # SQL select the data out into yaml?
@@ -9,6 +10,20 @@ module RedmineContracts
class BudgetPluginMigration class BudgetPluginMigration
@@data = nil @@data = nil
def self.check_for_installed_budget_plugin
if Redmine::Plugin.registered_plugins.keys.include?(:budget_plugin)
raise BudgetPluginInstalledError, "The budget plugin is still installed. Please remove it and retry the conversion"
end
end
def self.rename_old_tables
end
def self.migrate_contracts
end
def self.migrate(old_data) def self.migrate(old_data)
@@data = old_data @@data = old_data
+9
View File
@@ -0,0 +1,9 @@
namespace :redmine_contracts do
desc "Migrate data from the budget_plugin to redmine_contracts"
task :budget_migration => :environment do
RedmineContracts::BudgetPluginMigration.check_for_installed_budget_plugin
RedmineContracts::BudgetPluginMigration.rename_old_tables
RedmineContracts::BudgetPluginMigration.migrate_contracts
# RedmineContracts::BudgetPluginMigration.migrate
end
end