strong_migrations 0.7.1 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 947dda0ab2fa336611335b258b4eae34e7b60f38083e162fb6bf80d2237ce819
4
- data.tar.gz: 6744411d6b2a33d5ee54b910ef60652fcb992cbb700a59a31da3eb48c2cb5322
3
+ metadata.gz: f3410e3379861436cbec2b46796069db388fffea222fa50ff46b054a153fbdaf
4
+ data.tar.gz: f328bee4412388114e888557d9b691ed3dad10bd0a5bf1ffb93c09f0b48d6696
5
5
  SHA512:
6
- metadata.gz: 3e1b51f910a02835ab0612f8be9714dce1dd1024acc3745a4465588447e6e12d8a4bdb2903c66f9c5f8ccc67bb6877ec231ad5979b304aff0ee34e5e4bd1f0a2
7
- data.tar.gz: e739903401b7787ad66a929ff1f67b0e0b4ff9366571d25ad0349f680bf013adad95be38a1fc71c4f4039174b4ef7ee30764a9786e6b8677597a0d2bd6434749
6
+ metadata.gz: 7e588f76685aa486f38949629b2f0aebe5f1acf92a5b53a29b4e4e1f5f334439eec3ef915240736caf55cff1f21197369305ec073c6adbbedaf6477aabb282cb
7
+ data.tar.gz: 3e350c8a68ec076295d36aac330ff9eae5ad75329b9775fb8839319f7fbc99c62b8ea58ca5fc57ec36c750a510f9ae743a76fd6fedc7fd755d1e07b7ab7230b5
@@ -1,3 +1,7 @@
1
+ ## 0.7.2 (2020-10-25)
2
+
3
+ - Added support for float timeouts
4
+
1
5
  ## 0.7.1 (2020-07-27)
2
6
 
3
7
  - Added `target_version` option to replace database-specific options
data/README.md CHANGED
@@ -313,7 +313,7 @@ If you intend to drop an existing table, run `drop_table` first.
313
313
 
314
314
  #### Bad
315
315
 
316
- Setting `NOT NULL` on an existing column blocks reads and writes while the every row is checked.
316
+ Setting `NOT NULL` on an existing column blocks reads and writes while every row is checked.
317
317
 
318
318
  ```ruby
319
319
  class SetSomeColumnNotNull < ActiveRecord::Migration[6.0]
@@ -298,7 +298,8 @@ Then add the foreign key in separate migrations."
298
298
  if postgresql?
299
299
  "SET statement_timeout TO #{connection.quote(postgresql_timeout(StrongMigrations.statement_timeout))}"
300
300
  elsif mysql?
301
- "SET max_execution_time = #{connection.quote(StrongMigrations.statement_timeout.to_i * 1000)}"
301
+ # use ceil to prevent no timeout for values under 1 ms
302
+ "SET max_execution_time = #{connection.quote((StrongMigrations.statement_timeout.to_f * 1000).ceil)}"
302
303
  elsif mariadb?
303
304
  "SET max_statement_time = #{connection.quote(StrongMigrations.statement_timeout)}"
304
305
  else
@@ -404,6 +405,7 @@ Then add the foreign key in separate migrations."
404
405
  end
405
406
  elsif mysql? || mariadb?
406
407
  lock_timeout = connection.select_all("SHOW VARIABLES LIKE 'lock_wait_timeout'").first["Value"]
408
+ # lock timeout is an integer
407
409
  if lock_timeout.to_i > limit
408
410
  warn "[strong_migrations] DANGER: Lock timeout is longer than #{limit} seconds: #{lock_timeout}"
409
411
  end
@@ -436,7 +438,8 @@ Then add the foreign key in separate migrations."
436
438
  if timeout.is_a?(String)
437
439
  timeout
438
440
  else
439
- timeout.to_i * 1000
441
+ # use ceil to prevent no timeout for values under 1 ms
442
+ (timeout.to_f * 1000).ceil
440
443
  end
441
444
  end
442
445
 
@@ -1,3 +1,3 @@
1
1
  module StrongMigrations
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  - Bob Remeika
9
9
  - David Waller
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-07-27 00:00:00.000000000 Z
13
+ date: 2020-10-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -96,7 +96,7 @@ dependencies:
96
96
  - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
- description:
99
+ description:
100
100
  email:
101
101
  - andrew@chartkick.com
102
102
  - bob.remeika@gmail.com
@@ -122,7 +122,7 @@ homepage: https://github.com/ankane/strong_migrations
122
122
  licenses:
123
123
  - MIT
124
124
  metadata: {}
125
- post_install_message:
125
+ post_install_message:
126
126
  rdoc_options: []
127
127
  require_paths:
128
128
  - lib
@@ -137,8 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  requirements: []
140
- rubygems_version: 3.1.2
141
- signing_key:
140
+ rubygems_version: 3.1.4
141
+ signing_key:
142
142
  specification_version: 4
143
143
  summary: Catch unsafe migrations in development
144
144
  test_files: []