database_patcher 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -1
- data/Rakefile +3 -1
- data/lib/database_patcher/command/down.rb +1 -1
- data/lib/database_patcher/rake_task.rb +31 -0
- data/lib/database_patcher/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6f30ae5f966a66d023dedb2e52ec85352fcc2dc
|
4
|
+
data.tar.gz: f2dad5348b3d64fbf9e2655fd8c26bdb93a44db6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0262661418ce2071f9518ac20cef05d185f2b378a4a2af4da734cf02f5692088b3e3eed5bd6f4135351c6ba7af94279063066ed42bba86f1fec90979f3c4301
|
7
|
+
data.tar.gz: 7c4999481222febae37e67fa6f0c7b7bea7c2c8b75ed9b53c0931c99a0e0b4b0d3753b2f92653fc8425c8cb0c0e40175158d56423f2e2ddd4b1e0d7baee97336
|
data/README.md
CHANGED
@@ -60,4 +60,24 @@ The following commands supported:
|
|
60
60
|
# use <your favorite editor> to edit the file/files
|
61
61
|
$ database_patcher apply_pending_patches
|
62
62
|
|
63
|
-
Here is a [cheat sheet](http://sequel.jeremyevans.net/rdoc/files/doc/cheat_sheet_rdoc.html) if you want use the ruby syntax for creating patches
|
63
|
+
Here is a [cheat sheet](http://sequel.jeremyevans.net/rdoc/files/doc/cheat_sheet_rdoc.html) if you want use the ruby syntax for creating patches
|
64
|
+
|
65
|
+
### Rake integration
|
66
|
+
|
67
|
+
to use database_patcher from rake you can use the following:
|
68
|
+
|
69
|
+
#### Rakefile
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
require "database_patcher/rake_task"
|
73
|
+
```
|
74
|
+
|
75
|
+
$ rake -T
|
76
|
+
|
77
|
+
```sh
|
78
|
+
rake db:apply_pending_patches # apply pending schema migrations
|
79
|
+
rake db:create_patch[type,idempotent,description] # create a new migration patch
|
80
|
+
rake db:migrate # Alias task for apply_pending_patches
|
81
|
+
rake db:revert_installed_patches # apply pending schema migrations
|
82
|
+
rake db:rollback # rollback one patch
|
83
|
+
```
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'database_patcher'
|
2
2
|
class DatabasePatcher::Command::Down < DatabasePatcher::Command
|
3
|
-
names '
|
3
|
+
names 'revert_installed_patches', 'remove', 'down'
|
4
4
|
desc 'execute the down patches and remove all db patch'
|
5
5
|
|
6
6
|
on_call do |*_|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "database_patcher"
|
2
|
+
namespace :db do
|
3
|
+
|
4
|
+
desc 'apply pending schema migrations'
|
5
|
+
task :apply_pending_patches do
|
6
|
+
DatabasePatcher::Initializer.new.init
|
7
|
+
DatabasePatcher::PatchApplier.new.up
|
8
|
+
end
|
9
|
+
|
10
|
+
desc "Alias task for apply_pending_patches"
|
11
|
+
task :migrate => :apply_pending_patches
|
12
|
+
|
13
|
+
desc 'apply pending schema migrations'
|
14
|
+
task :revert_installed_patches do
|
15
|
+
DatabasePatcher::Initializer.new.init
|
16
|
+
DatabasePatcher::PatchApplier.new.down
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'rollback one patch'
|
20
|
+
task :rollback do
|
21
|
+
DatabasePatcher::Initializer.new.init
|
22
|
+
DatabasePatcher::PatchApplier.new.rollback
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'create a new migration patch'
|
26
|
+
task :create_patch, :type, :idempotent, :description do |t, args|
|
27
|
+
args.with_defaults(:type => 'ruby', :idempotent => false, :description => '')
|
28
|
+
DatabasePatcher::PatchCreator.new(args[:type], args[:idempotent],args[:description]).make
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: database_patcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- lib/database_patcher/patch_entity.rb
|
133
133
|
- lib/database_patcher/patch_entity/file.rb
|
134
134
|
- lib/database_patcher/patch_entity/folder.rb
|
135
|
+
- lib/database_patcher/rake_task.rb
|
135
136
|
- lib/database_patcher/version.rb
|
136
137
|
homepage: https://github.com/adamluzsi/database_patcher.rb
|
137
138
|
licenses: []
|