ridgepole 0.6.0.beta → 0.6.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91b851129e798ca93f666b4942b4fa163b061d96
4
- data.tar.gz: 19d3dd0442a52a650d2d1bfcc8adda3b6755335f
3
+ metadata.gz: e6ae74a3fb40232b6c6a0fba3cc64ca556684bba
4
+ data.tar.gz: ba614d9bc208b5d6ddbef3f125d30cd89d5e719c
5
5
  SHA512:
6
- metadata.gz: 5263173c6cca716198521b2c2a0802b6755a7cb9eb414756cf2d3e6fbcce61ac057d7eda74e0c3b95931d4df6ed8554933640f9d4952eea91878aa9193eb7cc4
7
- data.tar.gz: 0b12d04adeb3b76dd298199a5a88a467a30ff8149734cf5b9d311475bc0b82f482a661d381ff271eb3ca5260c858005cf9193fcb07b30d7a6faa4854a83d80da
6
+ metadata.gz: 787b4a10c9993dc834880c5593a89ee501709cf83c94f4686a0e12f2a3173363aaf6fc339c06a150287e4005bc481e263174dfc8673350a9bc20afcd4f942e95
7
+ data.tar.gz: 92843a96b3c721a54f5328215bda9d8f2778f7cb5744de6790e5db18b87182d043fcbdf3c781aec20a458da5411d704c91830dcb1020eecc0ac345b34fc1bc03
data/README.md CHANGED
@@ -60,6 +60,7 @@ Usage: ridgepole [options]
60
60
  --dry-run
61
61
  --table-options OPTIONS
62
62
  --bulk-change
63
+ --default-bool-limit LIMIT
63
64
  --default-int-limit LIMIT
64
65
  --default-float-limit LIMIT
65
66
  --default-string-limit LIMIT
data/bin/ridgepole CHANGED
@@ -68,7 +68,16 @@ ARGV.options do |opt|
68
68
  }
69
69
 
70
70
  Ridgepole::DEFAULTS_LIMITS.keys.each do |column_type|
71
- opt.on('', "--default-#{column_type == :integer ? :int : column_type}-limit LIMIT", Integer) {|v|
71
+ case column_type
72
+ when :integer
73
+ option_column_type = :int
74
+ when :boolean
75
+ option_column_type = :bool
76
+ else
77
+ option_column_type = column_type
78
+ end
79
+
80
+ opt.on('', "--default-#{option_column_type}-limit LIMIT", Integer) {|v|
72
81
  options[:"default_#{column_type}_limit"] = v
73
82
  }
74
83
  end
@@ -262,6 +262,7 @@ class Ridgepole::Diff
262
262
  def normalize_index_options!(opts)
263
263
  # XXX: MySQL only?
264
264
  opts[:using] = :btree unless opts.has_key?(:using)
265
+ opts[:unique] = false unless opts.has_key?(:unique)
265
266
  end
266
267
 
267
268
  def columns_all_include?(expected_columns, actual_columns, table_options)
@@ -1,3 +1,3 @@
1
1
  module Ridgepole
2
- VERSION = '0.6.0.beta'
2
+ VERSION = '0.6.0.beta2'
3
3
  end
data/lib/ridgepole.rb CHANGED
@@ -9,6 +9,7 @@ require 'active_support/core_ext'
9
9
  module Ridgepole
10
10
  # for MySQL
11
11
  DEFAULTS_LIMITS = {
12
+ :boolean => 1,
12
13
  :integer => 4,
13
14
  :float => 24,
14
15
  :string => 255,
@@ -17,6 +17,7 @@ describe 'ridgepole' do
17
17
  --dry-run
18
18
  --table-options OPTIONS
19
19
  --bulk-change
20
+ --default-bool-limit LIMIT
20
21
  --default-int-limit LIMIT
21
22
  --default-float-limit LIMIT
22
23
  --default-string-limit LIMIT
@@ -223,13 +223,13 @@ describe 'Ridgepole::Client#diff -> migrate' do
223
223
  expect(delta.differ?).to be_truthy
224
224
  expect(delta.script).to eq <<-RUBY.strip_heredoc.strip
225
225
  remove_index("dept_emp", {:name=>"emp_no"})
226
- add_index("dept_emp", ["emp_no"], {:name=>"emp_no", :using=>:btree})
226
+ add_index("dept_emp", ["emp_no"], {:name=>"emp_no", :using=>:btree, :unique=>false})
227
227
 
228
228
  remove_index("dept_manager", {:name=>"emp_no"})
229
- add_index("dept_manager", ["emp_no"], {:name=>"emp_no", :using=>:btree})
229
+ add_index("dept_manager", ["emp_no"], {:name=>"emp_no", :using=>:btree, :unique=>false})
230
230
 
231
231
  remove_index("salaries", {:name=>"emp_no"})
232
- add_index("salaries", ["emp_no"], {:name=>"emp_no", :using=>:btree})
232
+ add_index("salaries", ["emp_no"], {:name=>"emp_no", :using=>:btree, :unique=>false})
233
233
  RUBY
234
234
  }
235
235
 
@@ -240,17 +240,17 @@ describe 'Ridgepole::Client#diff -> migrate' do
240
240
  expect(delta.script).to eq <<-RUBY.strip_heredoc.strip
241
241
  change_table("dept_emp", {:bulk => true}) do |t|
242
242
  t.remove_index({:name=>"emp_no"})
243
- t.index(["from_date"], {:name=>"emp_no", :using=>:btree})
243
+ t.index(["from_date"], {:name=>"emp_no", :using=>:btree, :unique=>false})
244
244
  end
245
245
 
246
246
  change_table("dept_manager", {:bulk => true}) do |t|
247
247
  t.remove_index({:name=>"emp_no"})
248
- t.index(["from_date"], {:name=>"emp_no", :using=>:btree})
248
+ t.index(["from_date"], {:name=>"emp_no", :using=>:btree, :unique=>false})
249
249
  end
250
250
 
251
251
  change_table("salaries", {:bulk => true}) do |t|
252
252
  t.remove_index({:name=>"emp_no"})
253
- t.index(["from_date"], {:name=>"emp_no", :using=>:btree})
253
+ t.index(["from_date"], {:name=>"emp_no", :using=>:btree, :unique=>false})
254
254
  end
255
255
  RUBY
256
256
 
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.6.0.beta
4
+ version: 0.6.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-05 00:00:00.000000000 Z
11
+ date: 2015-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord