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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0df6fb1b72b3ab0c234c0f8b72c216dcff83b8c8
4
- data.tar.gz: bf7df0782ede514d34dfaa0338b208b25b70005c
3
+ metadata.gz: 69e07383f631bfa85f0f2e3fa67b41f14d643796
4
+ data.tar.gz: cfdcf4c62c27f9e65734596bb865464c53f824bf
5
5
  SHA512:
6
- metadata.gz: dc45bcdfc390d0f8fb556ca0e3fd8c3825cfea3de88acf76e5436fc96288aea717e141b97a4afd1ff61a17655b9636bf5e57aecef5f2f90cb14460e674610c64
7
- data.tar.gz: '088b3823dcdd796f3f8b1d49b78135f37a0afe8c479552ca63ddd33983fe37c9f5697e38b85cb7024e0d7ee773e8c32bafc20a850674046c584f818f770fb4a8'
6
+ metadata.gz: 2b9bbaace20b8d21a8d1923dc3e5ba9d7a70296a24ff3e185640745aba8344e537eefa8feac5cc78f0eff62003b924a0909e09cf775952e2097c7d0661a7e8c5
7
+ data.tar.gz: 8a1280a097d513e46769250a90401952bb49678425dc6ef4b24b4581db049c01e6adbf7fb6e969b08b5ab04c61d934d2ae3fd7d8822b0062761961a1c5c059dd
data/Appraisals CHANGED
@@ -4,5 +4,5 @@ appraise "activerecord-4.2" do
4
4
  end
5
5
 
6
6
  appraise 'activerecord-5.0' do
7
- gem 'activerecord', '>= 5.0.0'
7
+ gem 'activerecord', '~> 5.0.0'
8
8
  end
@@ -5,4 +5,4 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 4.2.0"
6
6
  gem "activerecord-mysql-awesome", ">= 0.0.7"
7
7
 
8
- gemspec :path => "../"
8
+ gemspec path: "../"
@@ -4,4 +4,4 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~> 5.0.0"
6
6
 
7
- gemspec :path => "../"
7
+ gemspec path: "../"
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Ridgepole
2
- VERSION = '0.6.6.beta2'
2
+ VERSION = '0.6.6.beta3'
3
3
  end
@@ -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 "titles", id: false, force: :cascade do |t|
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 "titles", ["emp_no"], name: "emp_no", using: :btree %>
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.beta2
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-04 00:00:00.000000000 Z
11
+ date: 2017-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord