ridgepole 0.7.1.beta3 → 0.7.1.beta4
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 +2 -0
- data/bin/ridgepole +1 -0
- data/lib/ridgepole/delta.rb +9 -3
- data/lib/ridgepole/version.rb +1 -1
- data/spec/mysql/cli/ridgepole_spec.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 573f4b844c5ea5951efd6c7a5807300a79545121
|
4
|
+
data.tar.gz: f94d8891b7acc9b42106bd2ccd7e08f8771f922a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5f191e59ef592721209cc97a4f1d019297d5d6d042e9f504665c365d35a3a55cbb4480fc6345966dc227fb35229e9012fbe866beb3e4641944d6d82f675b3f9
|
7
|
+
data.tar.gz: 693ab38c2cb409e988311872ee9e7586b10d834a654077d98b235c7cb8f10b8339a05cf7e8036dc7518ab8ae176d7555841ead84d61d59613fbddc088d4cbd74
|
data/README.md
CHANGED
@@ -81,6 +81,8 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
81
81
|
* Add `--ignore-table-comment` option
|
82
82
|
* `>= 0.7.1`
|
83
83
|
* Remove `--reverse` option
|
84
|
+
* Add `--allow-pk-change` option
|
85
|
+
* Add `--create-table-with-index` option
|
84
86
|
|
85
87
|
## Installation
|
86
88
|
|
data/bin/ridgepole
CHANGED
@@ -125,6 +125,7 @@ ARGV.options do |opt|
|
|
125
125
|
opt.on('', '--ignore-table-comment') { options[:ignore_table_comment] = true }
|
126
126
|
opt.on('', '--skip-column-comment-change') { options[:skip_column_comment_change] = true }
|
127
127
|
opt.on('', '--allow-pk-change') { options[:allow_pk_change] = true }
|
128
|
+
opt.on('', '--create-table-with-index') { options[:create_table_with_index] = true }
|
128
129
|
opt.on('-r', '--require LIBS', Array) {|v| v.each {|i| require i } }
|
129
130
|
opt.on('' , '--log-file LOG_FILE') {|v| options[:log_file] = v }
|
130
131
|
opt.on('' , '--verbose') { Ridgepole::Logger.verbose = true }
|
data/lib/ridgepole/delta.rb
CHANGED
@@ -235,11 +235,17 @@ create_table(#{table_name.inspect}, #{inspect_options_include_default_proc(optio
|
|
235
235
|
EOS
|
236
236
|
end
|
237
237
|
|
238
|
+
if @options[:create_table_with_index] and not indices.empty?
|
239
|
+
indices.each do |index_name, index_attrs|
|
240
|
+
append_add_index(table_name, index_name, index_attrs, buf, true)
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
238
244
|
buf.puts(<<-EOS)
|
239
245
|
end
|
240
246
|
EOS
|
241
247
|
|
242
|
-
|
248
|
+
if not @options[:create_table_with_index] and not indices.empty?
|
243
249
|
append_change_table(table_name, buf) do
|
244
250
|
indices.each do |index_name, index_attrs|
|
245
251
|
append_add_index(table_name, index_name, index_attrs, buf)
|
@@ -407,11 +413,11 @@ remove_column(#{table_name.inspect}, #{column_name.inspect})
|
|
407
413
|
end
|
408
414
|
end
|
409
415
|
|
410
|
-
def append_add_index(table_name, index_name, attrs, buf)
|
416
|
+
def append_add_index(table_name, index_name, attrs, buf, force_bulk_change = false)
|
411
417
|
column_name = attrs.fetch(:column_name)
|
412
418
|
options = attrs[:options] || {}
|
413
419
|
|
414
|
-
if @options[:bulk_change]
|
420
|
+
if force_bulk_change or @options[:bulk_change]
|
415
421
|
buf.puts(<<-EOS)
|
416
422
|
t.index(#{column_name.inspect}, #{options.inspect})
|
417
423
|
EOS
|
data/lib/ridgepole/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ridgepole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.1.
|
4
|
+
version: 0.7.1.beta4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -389,7 +389,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
389
389
|
version: 1.3.1
|
390
390
|
requirements: []
|
391
391
|
rubyforge_project:
|
392
|
-
rubygems_version: 2.
|
392
|
+
rubygems_version: 2.6.13
|
393
393
|
signing_key:
|
394
394
|
specification_version: 4
|
395
395
|
summary: Ridgepole is a tool to manage DB schema.
|