ridgepole 0.7.0.beta10 → 0.7.0.beta11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/bin/ridgepole +1 -0
- data/lib/ridgepole/default_limit.rb +1 -0
- data/lib/ridgepole/version.rb +1 -1
- data/spec/mysql/cli/ridgepole_spec.rb +1 -0
- data/spec/mysql/migrate/migrate_add_column2_spec.rb +46 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecc5673186f25067b337cfc75180d44b82bba7ce
|
4
|
+
data.tar.gz: 1601ea4b2ab780f97048bdc82b1896cffa3395fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba82871050164aca91fbcc7346a1d892bbc02de322f850ff70c6dd5ab41366b6a6bb1ffa609c7ad74f30be35ba839ccb0720d95bf2551721070d9a57e1514b37
|
7
|
+
data.tar.gz: a7e2278fd069aa686a2a9a652234d3ae069e23a4b46b822272b1310bcfadc4560f99e8e35984fb0e5aebd32bd35555f1d7fe916deeb913ce4d6d6da5ca3d45e8
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
9
9
|
[![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.6)](https://travis-ci.org/winebarrel/ridgepole)
|
10
10
|
[![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.6)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.6)
|
11
11
|
|
12
|
-
[![Edge Version](https://img.shields.io/badge/edge_version-0.7.0.
|
12
|
+
[![Edge Version](https://img.shields.io/badge/edge_version-0.7.0.beta11-brightgreen.svg)](https://rubygems.org/gems/ridgepole/versions/0.7.0.beta11)
|
13
13
|
[![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.7)](https://travis-ci.org/winebarrel/ridgepole)
|
14
14
|
[![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.7)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.7)
|
15
15
|
|
@@ -77,6 +77,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
77
77
|
* Fix change fk order
|
78
78
|
* Add `--check-relation-type` option
|
79
79
|
* Add `--skip-column-comment-change` option
|
80
|
+
* Add `--default-bigint-limit` option
|
80
81
|
|
81
82
|
## Installation
|
82
83
|
|
@@ -107,6 +108,7 @@ Usage: ridgepole [options]
|
|
107
108
|
--bulk-change
|
108
109
|
--default-bool-limit LIMIT
|
109
110
|
--default-int-limit LIMIT
|
111
|
+
--default-bigint-limit LIMIT
|
110
112
|
--default-float-limit LIMIT
|
111
113
|
--default-string-limit LIMIT
|
112
114
|
--default-text-limit LIMIT
|
data/bin/ridgepole
CHANGED
data/lib/ridgepole/version.rb
CHANGED
@@ -53,7 +53,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
53
53
|
let(:expected_dsl) {
|
54
54
|
<<-EOS
|
55
55
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
56
|
-
t.integer "emp_no", limit:
|
56
|
+
t.integer "emp_no", limit: 3, null: false
|
57
57
|
t.integer "emp_no2", null: false
|
58
58
|
t.string "dept_no", limit: 4, null: false
|
59
59
|
t.date "from_date", null: false
|
@@ -63,17 +63,17 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
63
63
|
}
|
64
64
|
|
65
65
|
before { subject.diff(actual_dsl).migrate }
|
66
|
-
subject { client(:
|
66
|
+
subject { client(:default_integer_limit => 3) }
|
67
67
|
|
68
68
|
it {
|
69
69
|
delta = subject.diff(expected_dsl)
|
70
70
|
expect(delta.differ?).to be_truthy
|
71
|
-
expect(subject.dump).to match_fuzzy actual_dsl
|
71
|
+
expect(subject.dump).to match_fuzzy actual_dsl.sub(/"emp_no"/, '"emp_no", limit: 3')
|
72
72
|
migrated, sql = delta.migrate(:noop => true)
|
73
73
|
expect(migrated).to be_truthy
|
74
|
-
expect(subject.dump).to match_fuzzy actual_dsl
|
74
|
+
expect(subject.dump).to match_fuzzy actual_dsl.sub(/"emp_no"/, '"emp_no", limit: 3')
|
75
75
|
|
76
|
-
expect(sql).to match_fuzzy erbh("ALTER TABLE `dept_emp` ADD `emp_no2`
|
76
|
+
expect(sql).to match_fuzzy erbh("ALTER TABLE `dept_emp` ADD `emp_no2` mediumint NOT NULL AFTER `emp_no`")
|
77
77
|
}
|
78
78
|
end
|
79
79
|
|
@@ -92,7 +92,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
92
92
|
let(:expected_dsl) {
|
93
93
|
<<-EOS
|
94
94
|
create_table "dept_emp", id: false, force: :cascade do |t|
|
95
|
-
t.integer "emp_no", limit:
|
95
|
+
t.integer "emp_no", limit: 3, null: false
|
96
96
|
t.integer "emp_no2", limit: 4, null: false
|
97
97
|
t.string "dept_no", limit: 4, null: false
|
98
98
|
t.date "from_date", null: false
|
@@ -102,7 +102,46 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
102
102
|
}
|
103
103
|
|
104
104
|
before { subject.diff(actual_dsl).migrate }
|
105
|
-
subject { client(:
|
105
|
+
subject { client(:default_integer_limit => 3) }
|
106
|
+
|
107
|
+
it {
|
108
|
+
delta = subject.diff(expected_dsl)
|
109
|
+
expect(delta.differ?).to be_truthy
|
110
|
+
expect(subject.dump).to match_fuzzy actual_dsl.sub(/"emp_no"/, '"emp_no", limit: 3')
|
111
|
+
migrated, sql = delta.migrate(:noop => true)
|
112
|
+
expect(migrated).to be_truthy
|
113
|
+
expect(subject.dump).to match_fuzzy actual_dsl.sub(/"emp_no"/, '"emp_no", limit: 3')
|
114
|
+
|
115
|
+
expect(sql).to match_fuzzy erbh("ALTER TABLE `dept_emp` ADD `emp_no2` int NOT NULL AFTER `emp_no`")
|
116
|
+
}
|
117
|
+
end
|
118
|
+
|
119
|
+
context 'when add column (bigint/noop)' do
|
120
|
+
let(:actual_dsl) {
|
121
|
+
erbh(<<-EOS)
|
122
|
+
create_table "dept_emp", id: false, force: :cascade do |t|
|
123
|
+
t.bigint "emp_no", null: false
|
124
|
+
t.string "dept_no", limit: 4, null: false
|
125
|
+
t.date "from_date", null: false
|
126
|
+
t.date "to_date", null: false
|
127
|
+
end
|
128
|
+
EOS
|
129
|
+
}
|
130
|
+
|
131
|
+
let(:expected_dsl) {
|
132
|
+
<<-EOS
|
133
|
+
create_table "dept_emp", id: false, force: :cascade do |t|
|
134
|
+
t.bigint "emp_no", limit: 9, null: false
|
135
|
+
t.integer "emp_no2", null: false
|
136
|
+
t.string "dept_no", limit: 4, null: false
|
137
|
+
t.date "from_date", null: false
|
138
|
+
t.date "to_date", null: false
|
139
|
+
end
|
140
|
+
EOS
|
141
|
+
}
|
142
|
+
|
143
|
+
before { subject.diff(actual_dsl).migrate }
|
144
|
+
subject { client(:default_bigint_limit => 9) }
|
106
145
|
|
107
146
|
it {
|
108
147
|
delta = subject.diff(expected_dsl)
|
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.0.
|
4
|
+
version: 0.7.0.beta11
|
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-06-
|
11
|
+
date: 2017-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|