mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #7140 from seamusabshere/patch-1
Make sure :environment task is executed before db:schema:load or db:structure:load
This commit is contained in:
commit
f784f218ea
2 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,10 @@
|
|||
## Rails 4.0.0 (unreleased) ##
|
||||
|
||||
* Make sure `:environment` task is executed before `db:schema:load` or `db:structure:load`
|
||||
Fixes #4772.
|
||||
|
||||
*Seamus Abshere*
|
||||
|
||||
* Allow Relation#merge to take a proc.
|
||||
|
||||
This was requested by DHH to allow creating of one's own custom
|
||||
|
|
|
@ -241,7 +241,7 @@ db_namespace = namespace :db do
|
|||
end
|
||||
end
|
||||
|
||||
task :load_if_ruby => 'db:create' do
|
||||
task :load_if_ruby => [:environment, 'db:create'] do
|
||||
db_namespace["schema:load"].invoke if ActiveRecord::Base.schema_format == :ruby
|
||||
end
|
||||
|
||||
|
@ -326,7 +326,7 @@ db_namespace = namespace :db do
|
|||
end
|
||||
end
|
||||
|
||||
task :load_if_sql => 'db:create' do
|
||||
task :load_if_sql => [:environment, 'db:create'] do
|
||||
db_namespace["structure:load"].invoke if ActiveRecord::Base.schema_format == :sql
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue