ridgepole 0.4.10.beta → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ridgepole/version.rb +1 -1
- data/spec/migrate/migrate_rename_table_spec.rb +41 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1d584003fbd27702c2fc29781c9860993134373
|
4
|
+
data.tar.gz: 2c5aae588f9b18515955fc99434e8919d8b87af8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94841e78eee16e09d990824b759d08bd9d130a81668da42fab85e05ff382fa71529e4b45f098d9d728d62a3b2733951427cb1371b6d4d28b2e019bad5aa4de86
|
7
|
+
data.tar.gz: aced3591d88cfc8bfee2575c5d51bbf9a2fac2d6a57fd1e492f786a267358dcadd58f8e0e673a047a4103a4fd0839e89fd23872a868c24a410b465e1ed6ba685
|
data/lib/ridgepole/version.rb
CHANGED
@@ -158,6 +158,47 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
158
158
|
}
|
159
159
|
end
|
160
160
|
|
161
|
+
context 'when rename table (dry-run)' do
|
162
|
+
let(:actual_dsl) {
|
163
|
+
<<-RUBY
|
164
|
+
create_table "employees", primary_key: "emp_no", force: true do |t|
|
165
|
+
t.date "birth_date", null: false
|
166
|
+
t.string "first_name", limit: 14, null: false
|
167
|
+
t.string "last_name", limit: 16, null: false
|
168
|
+
t.string "gender", limit: 1, null: false
|
169
|
+
t.date "hire_date", null: false
|
170
|
+
end
|
171
|
+
|
172
|
+
add_index "employees", ["first_name"], name: "first_name", using: :btree
|
173
|
+
RUBY
|
174
|
+
}
|
175
|
+
|
176
|
+
let(:expected_dsl) {
|
177
|
+
<<-RUBY
|
178
|
+
create_table "employees2", primary_key: "emp_no", force: true, renamed_from: 'employees' do |t|
|
179
|
+
t.date "birth_date", null: false
|
180
|
+
t.string "first_name", limit: 14, null: false
|
181
|
+
t.string "last_name", limit: 16, null: false
|
182
|
+
t.string "gender", limit: 1, null: false
|
183
|
+
t.date "hire_date", null: false
|
184
|
+
end
|
185
|
+
|
186
|
+
add_index "employees2", ["first_name"], name: "first_name", using: :btree
|
187
|
+
RUBY
|
188
|
+
}
|
189
|
+
|
190
|
+
before { subject.diff(actual_dsl).migrate }
|
191
|
+
subject { client }
|
192
|
+
|
193
|
+
it {
|
194
|
+
delta = subject.diff(expected_dsl)
|
195
|
+
expect(delta.differ?).to be_truthy
|
196
|
+
expect(subject.dump).to eq actual_dsl.strip_heredoc.strip
|
197
|
+
delta.migrate(noop: true)
|
198
|
+
expect(subject.dump).to eq actual_dsl.strip_heredoc.strip
|
199
|
+
}
|
200
|
+
end
|
201
|
+
|
161
202
|
context 'when rename table (not found)' do
|
162
203
|
before { restore_tables }
|
163
204
|
subject { client }
|
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.4.10
|
4
|
+
version: 0.4.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -218,9 +218,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
218
218
|
version: '0'
|
219
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
220
|
requirements:
|
221
|
-
- - '
|
221
|
+
- - '>='
|
222
222
|
- !ruby/object:Gem::Version
|
223
|
-
version:
|
223
|
+
version: '0'
|
224
224
|
requirements: []
|
225
225
|
rubyforge_project:
|
226
226
|
rubygems_version: 2.0.14
|