genesis 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/lib/genesis/tasks/genesis.rake +18 -1
- data/lib/genesis/version.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -20,7 +20,7 @@ seeding tools currently available.
|
|
20
20
|
* Genesis seed file generator similar to the Rails migration generator
|
21
21
|
* Seed version task
|
22
22
|
* Seeding task
|
23
|
-
* Database mulligan task (
|
23
|
+
* Database mulligan task (runs db:migrate:reset and then seeds)
|
24
24
|
* Only run seeds from the all and the current environment folder the task is being
|
25
25
|
executed within (ie. all seeds from db/seeds and db/seeds/production when rake
|
26
26
|
db:genesis RAILS_ENV=production)
|
@@ -27,8 +27,25 @@ namespace :db do
|
|
27
27
|
task :mulligan => :environment do
|
28
28
|
raise 'Cannot seed production' if ENV['RAILS_ENV'] == 'production' || Rails.env.production?
|
29
29
|
|
30
|
+
ENV['VERSION']= '0'
|
31
|
+
Rake::Task['db:migrate'].invoke
|
32
|
+
Rake::Task['db:migrate'].reenable
|
33
|
+
ENV.delete 'VERSION'
|
34
|
+
Rake::Task["db:migrate"].invoke
|
30
35
|
Genesis::SchemaSeed.delete_all
|
31
|
-
Rake::Task['db:
|
36
|
+
Rake::Task['db:genesis'].invoke
|
37
|
+
end
|
38
|
+
|
39
|
+
namespace :mulligan do
|
40
|
+
|
41
|
+
desc 'Recreates database using db:migrate:reset and db:seed (helpful when an irreversible migration is blocking db:mulligan)'
|
42
|
+
task :reset => :environment do
|
43
|
+
raise 'Cannot seed production' if ENV['RAILS_ENV'] == 'production' || Rails.env.production?
|
44
|
+
|
45
|
+
Rake::Task['db:migrate:reset'].invoke
|
46
|
+
Rake::Task['db:genesis'].invoke
|
47
|
+
end
|
48
|
+
|
32
49
|
end
|
33
50
|
|
34
51
|
desc "An alias for the db:genesis task"
|
data/lib/genesis/version.rb
CHANGED