forked from dim/retrospectiva
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dimitrij Denissenko
committed
Dec 5, 2009
1 parent
64e22cf
commit 819f974
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
require 'fileutils' | ||
namespace :db do | ||
|
||
# Create a schema.rb file if it is missing | ||
if defined?(RAILS_ROOT) && !File.exist?(File.join(RAILS_ROOT, 'db', 'schema.rb')) | ||
FileUtils.cp File.join(RAILS_ROOT, 'db', 'schema.core.rb'), File.join(RAILS_ROOT, 'db', 'schema.rb') | ||
end | ||
|
||
namespace :db do | ||
namespace :retro do | ||
task :load do | ||
STDERR.puts "Task db:retro:load is deprecated and was disabled; please use db:setup instead." | ||
end | ||
end | ||
|
||
namespace :schema do | ||
# Copy schema.core.rb to schema.rb if missing | ||
task :clone_core => :environment do | ||
unless File.exist?(Rails.root.join('db', 'schema.rb')) | ||
FileUtils.cp Rails.root.join('db', 'schema.core.rb'), Rails.root.join('db', 'schema.rb') | ||
end | ||
end | ||
end | ||
|
||
end | ||
|
||
Rake::Task['db:schema:load'].enhance ['db:schema:clone_core'] |