Permalink
Browse files

Create misssing schema.rb as part of the db:setup rake task

  • Loading branch information...
1 parent 465b99f commit c6780e55ee7827d001376491378424dc3ade34e4 Dimitrij Denissenko committed Dec 5, 2009
Showing with 12 additions and 6 deletions.
  1. +2 −0 .gitignore
  2. +0 −6 config/preinitializer.rb
  3. +10 −0 lib/tasks/database.rake
View
@@ -4,3 +4,5 @@ coverage
Capfile
.tmp*
*.*~
+vendor/gems
+vendor/rails
View
@@ -1,6 +0,0 @@
-require 'fileutils'
-
-# Create a schema.rb file if it is missing
-unless File.exist?(File.join(File.dirname(__FILE__), '..', 'db', 'schema.rb'))
- FileUtils.cp File.join(File.dirname(__FILE__), '..', 'db', 'schema.core.rb'), File.join(File.dirname(__FILE__), '..', 'db', 'schema.rb')
-end
View
@@ -1,3 +1,5 @@
+require 'fileutils'
+
namespace :db do
namespace :retro do
task :load do
@@ -6,3 +8,11 @@ namespace :db do
end
end
+Rake::Task['db:setup'].enhance do
+
+ # Create a schema.rb file if it is missing
+ unless File.exist?(File.join(File.dirname(__FILE__), '..', 'db', 'schema.rb'))
+ FileUtils.cp File.join(File.dirname(__FILE__), '..', 'db', 'schema.core.rb'), File.join(File.dirname(__FILE__), '..', 'db', 'schema.rb')
+ end
+
+end

0 comments on commit c6780e5

Please sign in to comment.