lhm-shopify 4.2.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +20 -0
- data/.github/workflows/test.yml +1 -1
- data/.gitignore +0 -1
- data/.ruby-version +1 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/dev.yml +1 -1
- data/gemfiles/activerecord_6.1.gemfile.lock +1 -1
- data/gemfiles/activerecord_7.0.gemfile.lock +1 -1
- data/gemfiles/activerecord_7.1.gemfile.lock +1 -1
- data/lib/lhm/migrator.rb +3 -3
- data/lib/lhm/sql_retry.rb +15 -2
- data/lib/lhm/version.rb +1 -1
- data/spec/integration/cleanup_spec.rb +1 -0
- data/spec/unit/migrator_spec.rb +4 -4
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c6d17339f7cb0ec6d9dfa2620e24e5912a4af9302e376297e212be626bd2b15
|
4
|
+
data.tar.gz: a50feeaf0d1fa60c07c0410b1e01024a82ec1b5b243bf25013ea57c5c7a84c07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcd984207e3b4a341ddf72b3be5674d175330a72b292e754a1e7d646924dd191a454c5dbe3c38ed1e2772f08347f3da2e467e16adb9bb107d4fd9f38b3d6d63d
|
7
|
+
data.tar.gz: 1e8e0771a774b017c2d8dd64092d7eaaf5fbaba98cbc5772e478be2871d882f55769607abe92b63bd10d62e717e3cb07d90e8e0bb685801994debd48ab618ebb
|
@@ -0,0 +1,20 @@
|
|
1
|
+
version: 2
|
2
|
+
registries:
|
3
|
+
ruby-shopify:
|
4
|
+
type: rubygems-server
|
5
|
+
url: https://pkgs.shopify.io/basic/gems/ruby
|
6
|
+
username: ${{secrets.RUBYGEMS_SERVER_PKGS_SHOPIFY_IO_USERNAME}}
|
7
|
+
password: ${{secrets.RUBYGEMS_SERVER_PKGS_SHOPIFY_IO_PASSWORD}}
|
8
|
+
github-com:
|
9
|
+
type: git
|
10
|
+
url: https://github.com
|
11
|
+
username: ${{secrets.DEPENDENCIES_GITHUB_USER}}
|
12
|
+
password: ${{secrets.DEPENDENCIES_GITHUB_TOKEN}}
|
13
|
+
updates:
|
14
|
+
- package-ecosystem: bundler
|
15
|
+
directory: "/"
|
16
|
+
schedule:
|
17
|
+
interval: daily
|
18
|
+
open-pull-requests-limit: 100
|
19
|
+
insecure-external-code-execution: allow
|
20
|
+
registries: "*"
|
data/.github/workflows/test.yml
CHANGED
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.2.2
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/dev.yml
CHANGED
data/lib/lhm/migrator.rb
CHANGED
@@ -53,7 +53,7 @@ module Lhm
|
|
53
53
|
# @param [String] name Name of the column to add
|
54
54
|
# @param [String] definition Valid SQL column definition
|
55
55
|
def add_column(name, definition)
|
56
|
-
ddl('alter table `%s` add column `%s` %s' % [@name, name, definition])
|
56
|
+
ddl('alter table `%s` add column `%s` %s, ALGORITHM=INPLACE' % [@name, name, definition])
|
57
57
|
end
|
58
58
|
|
59
59
|
# Change an existing column to a new definition
|
@@ -94,7 +94,7 @@ module Lhm
|
|
94
94
|
definition += " COMMENT #{@connection.quote(col[:comment])}" if col[:comment]
|
95
95
|
definition += " COLLATE #{@connection.quote(col[:collate])}" if col[:collate]
|
96
96
|
|
97
|
-
ddl('alter table `%s` change column `%s` `%s` %s' % [@name, old, nu, definition])
|
97
|
+
ddl('alter table `%s` change column `%s` `%s` %s, ALGORITHM=INPLACE' % [@name, old, nu, definition])
|
98
98
|
@renames[old.to_s] = nu.to_s
|
99
99
|
end
|
100
100
|
|
@@ -108,7 +108,7 @@ module Lhm
|
|
108
108
|
#
|
109
109
|
# @param [String] name Name of the column to delete
|
110
110
|
def remove_column(name)
|
111
|
-
ddl('alter table `%s` drop `%s
|
111
|
+
ddl('alter table `%s` drop `%s`, ALGORITHM=INPLACE' % [@name, name])
|
112
112
|
end
|
113
113
|
|
114
114
|
# Add an index to a table
|
data/lib/lhm/sql_retry.rb
CHANGED
@@ -186,13 +186,26 @@ module Lhm
|
|
186
186
|
def retriable_trilogy_errors
|
187
187
|
return unless defined?(Trilogy::BaseError)
|
188
188
|
|
189
|
-
{
|
189
|
+
errors = {
|
190
190
|
ActiveRecord::StatementInvalid => [
|
191
|
-
# Those sometimes appear as Trilogy::TimeoutError, and sometimes as ActiveRecord::StatementInvalid
|
192
191
|
/Lock wait timeout exceeded/,
|
192
|
+
/Timeout waiting for a response from the last query/,
|
193
|
+
/Deadlock found when trying to get lock/,
|
194
|
+
/Query execution was interrupted/,
|
195
|
+
/Lost connection to MySQL server during query/,
|
196
|
+
/Max connect timeout reached/,
|
197
|
+
/Unknown MySQL server host/,
|
198
|
+
/connection is locked to hostgroup/,
|
199
|
+
/The MySQL server is running with the --read-only option so it cannot execute this statement/,
|
193
200
|
],
|
194
201
|
Trilogy::ConnectionError => nil,
|
195
202
|
}
|
203
|
+
|
204
|
+
if ActiveRecord::VERSION::STRING >= "7.1"
|
205
|
+
errors[ActiveRecord::ConnectionFailed] = nil
|
206
|
+
end
|
207
|
+
|
208
|
+
errors
|
196
209
|
end
|
197
210
|
end
|
198
211
|
end
|
data/lib/lhm/version.rb
CHANGED
data/spec/unit/migrator_spec.rb
CHANGED
@@ -97,7 +97,7 @@ describe Lhm::Migrator do
|
|
97
97
|
@creator.add_column('logins', 'INT(12)')
|
98
98
|
|
99
99
|
value(@creator.statements).must_equal([
|
100
|
-
'alter table `lhmn_alt` add column `logins` INT(12)'
|
100
|
+
'alter table `lhmn_alt` add column `logins` INT(12), ALGORITHM=INPLACE'
|
101
101
|
])
|
102
102
|
end
|
103
103
|
|
@@ -105,7 +105,7 @@ describe Lhm::Migrator do
|
|
105
105
|
@creator.remove_column('logins')
|
106
106
|
|
107
107
|
value(@creator.statements).must_equal([
|
108
|
-
'alter table `lhmn_alt` drop `logins
|
108
|
+
'alter table `lhmn_alt` drop `logins`, ALGORITHM=INPLACE'
|
109
109
|
])
|
110
110
|
end
|
111
111
|
|
@@ -151,10 +151,10 @@ describe Lhm::Migrator do
|
|
151
151
|
value(@creator.statements.length).must_equal(2)
|
152
152
|
|
153
153
|
value(@creator.statements[0])
|
154
|
-
.must_equal('alter table `lhmn_alt` add column `first` VARCHAR(64)')
|
154
|
+
.must_equal('alter table `lhmn_alt` add column `first` VARCHAR(64), ALGORITHM=INPLACE')
|
155
155
|
|
156
156
|
value(@creator.statements[1])
|
157
|
-
.must_equal('alter table `lhmn_alt` add column `last` VARCHAR(64)')
|
157
|
+
.must_equal('alter table `lhmn_alt` add column `last` VARCHAR(64), ALGORITHM=INPLACE')
|
158
158
|
end
|
159
159
|
end
|
160
160
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhm-shopify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SoundCloud
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2024-
|
15
|
+
date: 2024-06-05 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: retriable
|
@@ -190,9 +190,11 @@ executables: []
|
|
190
190
|
extensions: []
|
191
191
|
extra_rdoc_files: []
|
192
192
|
files:
|
193
|
+
- ".github/dependabot.yml"
|
193
194
|
- ".github/workflows/test.yml"
|
194
195
|
- ".gitignore"
|
195
196
|
- ".rubocop.yml"
|
197
|
+
- ".ruby-version"
|
196
198
|
- Appraisals
|
197
199
|
- CHANGELOG.md
|
198
200
|
- Gemfile
|
@@ -320,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
320
322
|
- !ruby/object:Gem::Version
|
321
323
|
version: '0'
|
322
324
|
requirements: []
|
323
|
-
rubygems_version: 3.5.
|
325
|
+
rubygems_version: 3.5.11
|
324
326
|
signing_key:
|
325
327
|
specification_version: 4
|
326
328
|
summary: online schema changer for mysql
|