<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -215,14 +215,14 @@ namespace :db do
     desc &quot;Create a db/schema.rb file that can be portably used against any DB supported by AR&quot;
     task :dump =&gt; :environment do
       require 'active_record/schema_dumper'
-      File.open(ENV['SCHEMA'] || &quot;db/schema.rb&quot;, &quot;w&quot;) do |file|
+      File.open(ENV['SCHEMA'] || &quot;#{RAILS_ROOT}/db/schema.rb&quot;, &quot;w&quot;) do |file|
         ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file)
       end
     end
 
     desc &quot;Load a schema.rb file into the database&quot;
     task :load =&gt; :environment do
-      file = ENV['SCHEMA'] || &quot;db/schema.rb&quot;
+      file = ENV['SCHEMA'] || &quot;#{RAILS_ROOT}/db/schema.rb&quot;
       load(file)
     end
   end
@@ -234,7 +234,7 @@ namespace :db do
       case abcs[RAILS_ENV][&quot;adapter&quot;]
       when &quot;mysql&quot;, &quot;oci&quot;, &quot;oracle&quot;
         ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
-        File.open(&quot;db/#{RAILS_ENV}_structure.sql&quot;, &quot;w+&quot;) { |f| f &lt;&lt; ActiveRecord::Base.connection.structure_dump }
+        File.open(&quot;#{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;, &quot;w+&quot;) { |f| f &lt;&lt; ActiveRecord::Base.connection.structure_dump }
       when &quot;postgresql&quot;
         ENV['PGHOST']     = abcs[RAILS_ENV][&quot;host&quot;] if abcs[RAILS_ENV][&quot;host&quot;]
         ENV['PGPORT']     = abcs[RAILS_ENV][&quot;port&quot;].to_s if abcs[RAILS_ENV][&quot;port&quot;]
@@ -252,13 +252,13 @@ namespace :db do
       when &quot;firebird&quot;
         set_firebird_env(abcs[RAILS_ENV])
         db_string = firebird_db_string(abcs[RAILS_ENV])
-        sh &quot;isql -a #{db_string} &gt; db/#{RAILS_ENV}_structure.sql&quot;
+        sh &quot;isql -a #{db_string} &gt; #{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;
       else
         raise &quot;Task not supported by '#{abcs[&quot;test&quot;][&quot;adapter&quot;]}'&quot;
       end
 
       if ActiveRecord::Base.connection.supports_migrations?
-        File.open(&quot;db/#{RAILS_ENV}_structure.sql&quot;, &quot;a&quot;) { |f| f &lt;&lt; ActiveRecord::Base.connection.dump_schema_information }
+        File.open(&quot;#{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;, &quot;a&quot;) { |f| f &lt;&lt; ActiveRecord::Base.connection.dump_schema_information }
       end
     end
   end
@@ -281,28 +281,28 @@ namespace :db do
       when &quot;mysql&quot;
         ActiveRecord::Base.establish_connection(:test)
         ActiveRecord::Base.connection.execute('SET foreign_key_checks = 0')
-        IO.readlines(&quot;db/#{RAILS_ENV}_structure.sql&quot;).join.split(&quot;\n\n&quot;).each do |table|
+        IO.readlines(&quot;#{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;).join.split(&quot;\n\n&quot;).each do |table|
           ActiveRecord::Base.connection.execute(table)
         end
       when &quot;postgresql&quot;
         ENV['PGHOST']     = abcs[&quot;test&quot;][&quot;host&quot;] if abcs[&quot;test&quot;][&quot;host&quot;]
         ENV['PGPORT']     = abcs[&quot;test&quot;][&quot;port&quot;].to_s if abcs[&quot;test&quot;][&quot;port&quot;]
         ENV['PGPASSWORD'] = abcs[&quot;test&quot;][&quot;password&quot;].to_s if abcs[&quot;test&quot;][&quot;password&quot;]
-        `psql -U &quot;#{abcs[&quot;test&quot;][&quot;username&quot;]}&quot; -f db/#{RAILS_ENV}_structure.sql #{abcs[&quot;test&quot;][&quot;database&quot;]}`
+        `psql -U &quot;#{abcs[&quot;test&quot;][&quot;username&quot;]}&quot; -f #{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql #{abcs[&quot;test&quot;][&quot;database&quot;]}`
       when &quot;sqlite&quot;, &quot;sqlite3&quot;
         dbfile = abcs[&quot;test&quot;][&quot;database&quot;] || abcs[&quot;test&quot;][&quot;dbfile&quot;]
-        `#{abcs[&quot;test&quot;][&quot;adapter&quot;]} #{dbfile} &lt; db/#{RAILS_ENV}_structure.sql`
+        `#{abcs[&quot;test&quot;][&quot;adapter&quot;]} #{dbfile} &lt; #{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql`
       when &quot;sqlserver&quot;
         `osql -E -S #{abcs[&quot;test&quot;][&quot;host&quot;]} -d #{abcs[&quot;test&quot;][&quot;database&quot;]} -i db\\#{RAILS_ENV}_structure.sql`
       when &quot;oci&quot;, &quot;oracle&quot;
         ActiveRecord::Base.establish_connection(:test)
-        IO.readlines(&quot;db/#{RAILS_ENV}_structure.sql&quot;).join.split(&quot;;\n\n&quot;).each do |ddl|
+        IO.readlines(&quot;#{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql&quot;).join.split(&quot;;\n\n&quot;).each do |ddl|
           ActiveRecord::Base.connection.execute(ddl)
         end
       when &quot;firebird&quot;
         set_firebird_env(abcs[&quot;test&quot;])
         db_string = firebird_db_string(abcs[&quot;test&quot;])
-        sh &quot;isql -i db/#{RAILS_ENV}_structure.sql #{db_string}&quot;
+        sh &quot;isql -i #{RAILS_ROOT}/db/#{RAILS_ENV}_structure.sql #{db_string}&quot;
       else
         raise &quot;Task not supported by '#{abcs[&quot;test&quot;][&quot;adapter&quot;]}'&quot;
       end</diff>
      <filename>railties/lib/tasks/databases.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>68fe898189a27e4e3c4c2fe005c99975d40e1dd7</id>
    </parent>
  </parents>
  <author>
    <name>Tapaj&#243;s</name>
    <email>tapajos@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/0d241f4434bafa2107cd6c3f3ab77c05f5d5ec71</url>
  <id>0d241f4434bafa2107cd6c3f3ab77c05f5d5ec71</id>
  <committed-date>2008-07-13T12:19:03-07:00</committed-date>
  <authored-date>2008-07-13T12:19:03-07:00</authored-date>
  <message>Use full path in database tasks so commands will work outside of Rails root [#612 state:resolved]

Signed-off-by: Joshua Peek &lt;josh@joshpeek.com&gt;</message>
  <tree>3464600b66dcabcadf704c5e8e678d58117ce03b</tree>
  <committer>
    <name>Joshua Peek</name>
    <email>josh@joshpeek.com</email>
  </committer>
</commit>
