db-migrate 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -0
- data/bin/migrate +6 -1
- data/db-migrate.gemspec +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: 269317820863d87e14cb70c7b54074cfb32b8c4e
|
4
|
+
data.tar.gz: 57cff56d804d331d9b7dc1f9bf9f2c4b3e2d3fb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e88d20a9700571b789842ed65b49e1e21416158928ba382ad43942649615a443cbc00caf2d09d5804ee1893ad6a1d2e31e891b217076356fc3dbc062c3d0945
|
7
|
+
data.tar.gz: a06657674360747b4d5c64818f9c08753ffc3a89a9603d2783883e3ec5a2aeb8f1c2d57d5907c85e7dc72040891fafd3ced6c1b55174a9a6f147bf8e9dfb485d
|
data/README.md
CHANGED
@@ -28,6 +28,9 @@ It supports multiple databases and multiple languages for executing migrations.
|
|
28
28
|
- Javascript (Node.js)
|
29
29
|
- Go
|
30
30
|
|
31
|
+
#### Additional features
|
32
|
+
- ENV variables support in configuration file
|
33
|
+
|
31
34
|
## How to use it?
|
32
35
|
|
33
36
|
##### --help
|
@@ -51,6 +54,28 @@ Options:
|
|
51
54
|
#### init
|
52
55
|
First thing you have to do is to make initial configuration with **migrate init** command.
|
53
56
|
|
57
|
+
**migrate** will look for file `migrate.conf`. If file exists, it will make configuration based on file contents.
|
58
|
+
Example configuration file:
|
59
|
+
|
60
|
+
```bash
|
61
|
+
# pg or mysql
|
62
|
+
storage=pg
|
63
|
+
# can be one of: sql, ruby, javascript, go, python
|
64
|
+
lang=sql
|
65
|
+
# db host
|
66
|
+
host=localhost
|
67
|
+
# db port
|
68
|
+
port=5432
|
69
|
+
# name of database to use
|
70
|
+
database=mydb
|
71
|
+
# db user
|
72
|
+
user=myuser
|
73
|
+
# db password
|
74
|
+
password=${SOME_ENV_VARIABLE}
|
75
|
+
```
|
76
|
+
|
77
|
+
If configuration file does not exist, it will run interactive configuration file creation process. You will answer few questions about your database, and **migrate** will create configuration file for you.
|
78
|
+
|
54
79
|
#### new
|
55
80
|
After that you can start generating migrations by using **migrate new** command. This will generate migration script for you based on your prefered language.
|
56
81
|
|
data/bin/migrate
CHANGED
@@ -41,8 +41,11 @@ class CLI < Thor
|
|
41
41
|
|
42
42
|
desc "init", "make configuration file"
|
43
43
|
def init
|
44
|
+
generated_config = false
|
45
|
+
|
44
46
|
if @migrator == nil
|
45
47
|
Log.info("Creating configuration...")
|
48
|
+
generated_config = true
|
46
49
|
|
47
50
|
storage = nil
|
48
51
|
$asker.choose do |menu|
|
@@ -113,7 +116,9 @@ class CLI < Thor
|
|
113
116
|
@migrator.init
|
114
117
|
rescue Exception => e
|
115
118
|
Log.error("Error while initialization.", e)
|
116
|
-
|
119
|
+
if generated_config
|
120
|
+
@config.delete
|
121
|
+
end
|
117
122
|
exit
|
118
123
|
end
|
119
124
|
|
data/db-migrate.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'db-migrate'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.1'
|
4
4
|
s.licenses = ['MIT']
|
5
5
|
s.summary = "Tool for managing and executing your database migrations."
|
6
6
|
s.description = "#{s.summary} It supports multiple databases and multiple languages for writing migration scripts."
|