From fbcdfee622729792ab58648228209bbd3c2142b6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 5 Mar 2008 12:54:20 +0000 Subject: [PATCH] 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 --- lib/tasks/migrate_from_trac.rake | 13 ++++++++++--- 1 file 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 -- 2.39.5