capistrano-db-rollback 0.1.0 → 0.1.1
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 +5 -0
- data/VERSION +1 -1
- data/capistrano-db-rollback.gemspec +1 -1
- data/lib/capistrano-db-rollback.rb +10 -8
- metadata +6 -6
data/README.rdoc
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
A small capistrano recipe to rollback db migrations along with deploy:rollback
|
4
4
|
|
5
|
+
Usage:
|
6
|
+
|
7
|
+
1. Add the dependency in Gemfile - gem "capistrano-db-rollback"
|
8
|
+
2. Add the dependency in Capfile - require "capistrano-db-rollback"
|
9
|
+
|
5
10
|
== Contributing to capistrano-db-rollback
|
6
11
|
|
7
12
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -3,14 +3,16 @@ configuration = Capistrano::Configuration.respond_to?(:instance) ?
|
|
3
3
|
Capistrano.configuration(:must_exist)
|
4
4
|
|
5
5
|
configuration.load do
|
6
|
-
namespace :
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
namespace :deploy do
|
7
|
+
namespace :rollback do
|
8
|
+
desc <<-DESC
|
9
|
+
Rolls back the migration to the version found in schema.rb file of the previous release path.\
|
10
|
+
Uses sed command to read the version from schema.rb file.
|
11
|
+
DESC
|
12
|
+
task :migrations do
|
13
|
+
run "cd #{current_release}; rake db:migrate RAILS_ENV=#{rails_env} VERSION=`grep \":version =>\" #{previous_release}/db/schema.rb | sed -e 's/[a-z A-Z = \> \: \. \( \)]//g'`"
|
14
|
+
end
|
15
|
+
after "deploy:rollback","deploy:rollback:migrations"
|
13
16
|
end
|
14
|
-
after "deploy:rollback","deploy:rollback:migrations"
|
15
17
|
end
|
16
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-db-rollback
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
17
|
-
requirement: &
|
17
|
+
requirement: &89429330 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 1.0.0
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *89429330
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: jeweler
|
28
|
-
requirement: &
|
28
|
+
requirement: &89429090 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: 1.6.4
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *89429090
|
37
37
|
description: It assumes that the schema.rb is checked in with the correct version
|
38
38
|
into the repository. Reads the version from the schema.rb file and runs the db:migrate
|
39
39
|
with that task
|
@@ -68,7 +68,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
segments:
|
70
70
|
- 0
|
71
|
-
hash:
|
71
|
+
hash: 1009804979
|
72
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|