The answer is simple: from the database.
By the way, when you look at the db source code: * tasks (... / activerecord / railties / databases.rake), you can see that the migration tasks call the scheme: dump after startup
desc "Migrate the database (options: VERSION=x, VERBOSE=false)." task :migrate => :environment do ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true ActiveRecord::Migrator.migrate("db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil) Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby end
Thus, the migration works so that it changes the database and then generates a schema.rb file.
Radek Paviensky Sep 28 '10 at 18:13 2010-09-28 18:13
source share