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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +25 -0
  3. data/bin/migrate +6 -1
  4. data/db-migrate.gemspec +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac44f2774f5bba1b5c0dd8dfc04e423361e92d70
4
- data.tar.gz: 48aadd589116df00d4e840a827fa0a94e98f26e1
3
+ metadata.gz: 269317820863d87e14cb70c7b54074cfb32b8c4e
4
+ data.tar.gz: 57cff56d804d331d9b7dc1f9bf9f2c4b3e2d3fb7
5
5
  SHA512:
6
- metadata.gz: 4174f718724905b41d451e9ac0a3d1fea778f657bb04e590b62053b011e4a7eec3283d9140f9472f9854bea07bad425b93a8df5d64dd94b8bafe490857c107bf
7
- data.tar.gz: 24d4d0239d8b23262b6daa86b89d8f8e37ba43e6c7f853cb43915d669b47f916011f37adbca9a2e3916d56ca7b751a1c69415fa8982fe3c9e40c5f20563c113e
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
 
@@ -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
- @config.delete
119
+ if generated_config
120
+ @config.delete
121
+ end
117
122
  exit
118
123
  end
119
124
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'db-migrate'
3
- s.version = '0.1.0'
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."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db-migrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Pusic