genesis 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
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 (clears the schema_Seeds table and then runs db:reset)
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:reset'].invoke
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"
@@ -1,3 +1,3 @@
1
1
  module Genesis
2
- VERSION = "1.6.0"
2
+ VERSION = "1.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: