ridgepole 0.6.6.beta2 → 0.6.6.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +1 -1
- data/gemfiles/activerecord_4.2.gemfile +1 -1
- data/gemfiles/activerecord_5.0.gemfile +1 -1
- data/lib/ridgepole/diff.rb +4 -0
- data/lib/ridgepole/version.rb +1 -1
- data/spec/mysql/migrate/migrate_rename_table_spec.rb +24 -3
- 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: 69e07383f631bfa85f0f2e3fa67b41f14d643796
|
4
|
+
data.tar.gz: cfdcf4c62c27f9e65734596bb865464c53f824bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b9bbaace20b8d21a8d1923dc3e5ba9d7a70296a24ff3e185640745aba8344e537eefa8feac5cc78f0eff62003b924a0909e09cf775952e2097c7d0661a7e8c5
|
7
|
+
data.tar.gz: 8a1280a097d513e46769250a90401952bb49678425dc6ef4b24b4581db049c01e6adbf7fb6e969b08b5ab04c61d934d2ae3fd7d8822b0062761961a1c5c059dd
|
data/Appraisals
CHANGED
data/lib/ridgepole/diff.rb
CHANGED
@@ -55,6 +55,8 @@ class Ridgepole::Diff
|
|
55
55
|
next unless target?(table_name)
|
56
56
|
|
57
57
|
if (from_table_name = (to_attrs[:options] || {}).delete(:renamed_from))
|
58
|
+
from_table_name = from_table_name.to_s if from_table_name
|
59
|
+
|
58
60
|
# Already renamed
|
59
61
|
next if from[table_name]
|
60
62
|
|
@@ -195,6 +197,8 @@ class Ridgepole::Diff
|
|
195
197
|
def scan_column_rename(from, to, definition_delta)
|
196
198
|
to.dup.each do |column_name, to_attrs|
|
197
199
|
if (from_column_name = (to_attrs[:options] || {}).delete(:renamed_from))
|
200
|
+
from_column_name = from_column_name.to_s if from_column_name
|
201
|
+
|
198
202
|
# Already renamed
|
199
203
|
next if from[column_name]
|
200
204
|
|
data/lib/ridgepole/version.rb
CHANGED
@@ -127,14 +127,14 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
127
127
|
|
128
128
|
<%= add_index "salaries", ["emp_no"], name: "emp_no", using: :btree %>
|
129
129
|
|
130
|
-
create_table "
|
130
|
+
create_table "titles2", id: false, force: :cascade, renamed_from: :titles do |t|
|
131
131
|
t.integer "emp_no", <%= i limit(4) + {null: false} %>
|
132
132
|
t.string "title", limit: 50, null: false
|
133
133
|
t.date "from_date", null: false
|
134
134
|
t.date "to_date"
|
135
135
|
end
|
136
136
|
|
137
|
-
<%= add_index "
|
137
|
+
<%= add_index "titles2", ["emp_no"], name: "emp_no", using: :btree %>
|
138
138
|
EOS
|
139
139
|
}
|
140
140
|
|
@@ -146,7 +146,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
146
146
|
expect(delta.differ?).to be_truthy
|
147
147
|
expect(subject.dump).to match_fuzzy actual_dsl
|
148
148
|
delta.migrate
|
149
|
-
expect(subject.dump).to match_fuzzy expected_dsl.gsub(/, renamed_from: 'employees'/, '')
|
149
|
+
expect(subject.dump).to match_fuzzy expected_dsl.gsub(/, renamed_from: ('employees'|:titles)/, '')
|
150
150
|
}
|
151
151
|
|
152
152
|
it {
|
@@ -154,6 +154,7 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
154
154
|
expect(delta.differ?).to be_truthy
|
155
155
|
expect(delta.script).to match_fuzzy <<-EOS
|
156
156
|
rename_table("employees2", "employees")
|
157
|
+
rename_table("titles2", "titles")
|
157
158
|
EOS
|
158
159
|
}
|
159
160
|
end
|
@@ -170,6 +171,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
170
171
|
end
|
171
172
|
|
172
173
|
<%= add_index "employees", ["first_name"], name: "first_name", using: :btree %>
|
174
|
+
|
175
|
+
create_table "employees3", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %> do |t|
|
176
|
+
t.date "birth_date", null: false
|
177
|
+
t.string "first_name", limit: 14, null: false
|
178
|
+
t.string "last_name", limit: 16, null: false
|
179
|
+
t.string "gender", limit: 1, null: false
|
180
|
+
t.date "hire_date", null: false
|
181
|
+
end
|
182
|
+
|
183
|
+
<%= add_index "employees3", ["first_name"], name: "first_name", using: :btree %>
|
173
184
|
EOS
|
174
185
|
}
|
175
186
|
|
@@ -184,6 +195,16 @@ describe 'Ridgepole::Client#diff -> migrate' do
|
|
184
195
|
end
|
185
196
|
|
186
197
|
<%= add_index "employees2", ["first_name"], name: "first_name", using: :btree %>
|
198
|
+
|
199
|
+
create_table "employees4", primary_key: "emp_no", <%= i unsigned(true) + {force: :cascade} %>, renamed_from: :employees3 do |t|
|
200
|
+
t.date "birth_date", null: false
|
201
|
+
t.string "first_name", limit: 14, null: false
|
202
|
+
t.string "last_name", limit: 16, null: false
|
203
|
+
t.string "gender", limit: 1, null: false
|
204
|
+
t.date "hire_date", null: false
|
205
|
+
end
|
206
|
+
|
207
|
+
<%= add_index "employees4", ["first_name"], name: "first_name", using: :btree %>
|
187
208
|
EOS
|
188
209
|
}
|
189
210
|
|
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.6.
|
4
|
+
version: 0.6.6.beta3
|
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-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|