summaryrefslogtreecommitdiffstats
path: root/lib/tasks
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-03-05 12:54:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-03-05 12:54:20 +0000
commitfbcdfee622729792ab58648228209bbd3c2142b6 (patch)
tree659880c15c37f280385533779aa7e38b4621a0a5 /lib/tasks
parenta70737ad592cb6c695db29dc1c3579f616877175 (diff)
downloadredmine-fbcdfee622729792ab58648228209bbd3c2142b6.tar.gz
redmine-fbcdfee622729792ab58648228209bbd3c2142b6.zip
Trac importer: support database schema for Trac migration (#757 by John Goerzen).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1195 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/migrate_from_trac.rake13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake
index 9ae1c550a..d61640bfb 100644
--- a/lib/tasks/migrate_from_trac.rake
+++ b/lib/tasks/migrate_from_trac.rake
@@ -513,7 +513,11 @@ namespace :redmine do
@@trac_db_password = password
end
- mattr_reader :trac_directory, :trac_adapter, :trac_db_host, :trac_db_port, :trac_db_name, :trac_db_username, :trac_db_password
+ def self.set_trac_db_schema(schema)
+ @@trac_db_schema = schema
+ end
+
+ mattr_reader :trac_directory, :trac_adapter, :trac_db_host, :trac_db_port, :trac_db_name, :trac_db_schema, :trac_db_username, :trac_db_password
def self.trac_db_path; "#{trac_directory}/db/trac.db" end
def self.trac_attachments_directory; "#{trac_directory}/attachments" end
@@ -544,7 +548,9 @@ namespace :redmine do
:host => trac_db_host,
:port => trac_db_port,
:username => trac_db_username,
- :password => trac_db_password}
+ :password => trac_db_password,
+ :schema_search_path => trac_db_schema
+ }
end
end
@@ -580,7 +586,7 @@ namespace :redmine do
end
end
- DEFAULT_PORTS = {'mysql' => 3306, 'postgresl' => 5432}
+ DEFAULT_PORTS = {'mysql' => 3306, 'postgresql' => 5432}
prompt('Trac directory') {|directory| TracMigrate.set_trac_directory directory.strip}
prompt('Trac database adapter (sqlite, sqlite3, mysql, postgresql)', :default => 'sqlite') {|adapter| TracMigrate.set_trac_adapter adapter}
@@ -588,6 +594,7 @@ namespace :redmine do
prompt('Trac database host', :default => 'localhost') {|host| TracMigrate.set_trac_db_host host}
prompt('Trac database port', :default => DEFAULT_PORTS[TracMigrate.trac_adapter]) {|port| TracMigrate.set_trac_db_port port}
prompt('Trac database name') {|name| TracMigrate.set_trac_db_name name}
+ prompt('Trac database schema', :default => 'public') {|schema| TracMigrate.set_trac_db_schema schema}
prompt('Trac database username') {|username| TracMigrate.set_trac_db_username username}
prompt('Trac database password') {|password| TracMigrate.set_trac_db_password password}
end