db_patch 0.0.1 → 0.1.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.
- checksums.yaml +4 -4
- data/README.md +89 -1
- data/lib/db_patch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59e581d757718909d0fdd2cbc35320362df1fbfc
|
|
4
|
+
data.tar.gz: e3b5fe49d2cd428d955576cdc3d640c3a42b7e87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b15ea07db56a9f6f92fe14ab7f83f23d4a45a599db4158b95a6e092ff3a03c21c63b53e267dbd8c7fb9dc9878a64185b249b12a998e14d30f488c1720d00f698
|
|
7
|
+
data.tar.gz: b48e89afeff89e42ca63a585ee696ddbd13716fb6cf803e423d7bf46964e070fb0fbd003349e840645cbfac557331900e604a07ea22def315dedcaa09c3d9d8b
|
data/README.md
CHANGED
|
@@ -1,2 +1,90 @@
|
|
|
1
1
|
# rails_db_patch
|
|
2
|
-
Manage tool for ruby script which executed to DB
|
|
2
|
+
Manage tool for one-time ruby script which executed to DB in Rails application.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
You write one-time script for manipulate db.
|
|
8
|
+
then you'll test it in your environment. if it is OK, now you execute it to production environment.
|
|
9
|
+
|
|
10
|
+
by the way, where the script should be commit to?
|
|
11
|
+
Surely the script was finished the role(rest in peace..)
|
|
12
|
+
|
|
13
|
+
but.
|
|
14
|
+
|
|
15
|
+
Any chance.
|
|
16
|
+
it the customer request you to create new environment?
|
|
17
|
+
if your colleague destroyed Database?
|
|
18
|
+
|
|
19
|
+
the script will called from hell to revive the environment.
|
|
20
|
+
|
|
21
|
+
and, you'll say "*I trashed that script!!!!*"
|
|
22
|
+
|
|
23
|
+
you'll think "*I wish I can also manage one-time script also like migration file.*"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### **This is it.**
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
First after installed, you need to initialize database.
|
|
32
|
+
it creates 'patch_versions' table to DB.
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
rake db:patch:init
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Craete new blank script file.
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
rake db:patch:new
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
and execute the script to DB.
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
rake db:patch:execute
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
if you want to clear add patch history. execute this command.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
rake db:patch:clear
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Install
|
|
59
|
+
|
|
60
|
+
add Gemfile.
|
|
61
|
+
|
|
62
|
+
```Gemfile
|
|
63
|
+
gem "db_patch"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
and install.
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
bundle install
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
then, It enable to use db_patch tasks.
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
$ rake -T
|
|
76
|
+
rake db:patch:clear # clear database
|
|
77
|
+
rake db:patch:execute # execute path
|
|
78
|
+
rake db:patch:init # initialize database
|
|
79
|
+
rake db:patch:new # create new patch file
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Contribution
|
|
83
|
+
|
|
84
|
+
## Licence
|
|
85
|
+
|
|
86
|
+
[MIT](https://github.com/jacoyutorius/rails_db_patch/blob/master/MIT-LICENSE)
|
|
87
|
+
|
|
88
|
+
## Author
|
|
89
|
+
|
|
90
|
+
[jacoyutroius](https://github.com/jacoyutorius)
|
data/lib/db_patch/version.rb
CHANGED