strong_migrations 0.7.6 → 0.7.7

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
  SHA256:
3
- metadata.gz: f16481df30c6b961477b4a537034097aa1d41a262bd7f2741c40b7e6dae9cb9e
4
- data.tar.gz: 816bc9a4f9810bce6ac6d5e0a52b185800515794ca5e3d27b5f4d512a9190115
3
+ metadata.gz: de58409c64c5050d99432576f5d38f615de75832de7214960f9f686248bfa31c
4
+ data.tar.gz: d6113e7875c2b0f75e4548117692af874ffa12d7ebea731ed94344069661399d
5
5
  SHA512:
6
- metadata.gz: 2ac9f7c38958c1cc2e80efa3f895730087ac92a3675be31c308f9f8df827ced3323ca8bc3e69c99e2a79b92ef0a5a8b595a76715bf55c45b5698fcdd43b5a586
7
- data.tar.gz: 2cee8d3013ae8780f0bcbce33f22a219375c29f059335902cdfe2285ec557307229b7ec4544e6be59ea1ee7cd039f2b23e9b3693efc41f11f677cbbed1495896
6
+ metadata.gz: 23655309809f41dbe53842ee01ac8f573153ed49936f003bef0076591ec26f2bff7464c32fbf35ca8e2037e2eb8227c0e6c12b2e8c609e9cd05ccd6127474620
7
+ data.tar.gz: 501307d37d8577552735553b0e4b6f96f9afa415d3ed5737a06f16c44227ad7996daea70a9b2a480303678135c45806c410eacce03e125a92c2929b531bbdb34
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.7.7 (2021-06-07)
2
+
3
+ - Removed timeouts and `auto_analyze` from schema load
4
+
1
5
  ## 0.7.6 (2021-01-17)
2
6
 
3
7
  - Fixed `NOT NULL` constraint check for quoted columns
@@ -340,11 +340,7 @@ Then add the foreign key in separate migrations."
340
340
 
341
341
  # outdated statistics + a new index can hurt performance of existing queries
342
342
  if StrongMigrations.auto_analyze && direction == :up && method == :add_index
343
- if postgresql?
344
- connection.execute "ANALYZE #{connection.quote_table_name(args[0].to_s)}"
345
- elsif mariadb? || mysql?
346
- connection.execute "ANALYZE TABLE #{connection.quote_table_name(args[0].to_s)}"
347
- end
343
+ analyze_table(args[0])
348
344
  end
349
345
 
350
346
  result
@@ -396,8 +392,7 @@ Then add the foreign key in separate migrations."
396
392
  end
397
393
 
398
394
  def safe?
399
- @safe || ENV["SAFETY_ASSURED"] || @migration.is_a?(ActiveRecord::Schema) ||
400
- (direction == :down && !StrongMigrations.check_down) || version_safe?
395
+ @safe || ENV["SAFETY_ASSURED"] || (direction == :down && !StrongMigrations.check_down) || version_safe?
401
396
  end
402
397
 
403
398
  def version_safe?
@@ -508,6 +503,14 @@ Then add the foreign key in separate migrations."
508
503
  end
509
504
  end
510
505
 
506
+ def analyze_table(table)
507
+ if postgresql?
508
+ connection.execute "ANALYZE #{connection.quote_table_name(table.to_s)}"
509
+ elsif mariadb? || mysql?
510
+ connection.execute "ANALYZE TABLE #{connection.quote_table_name(table.to_s)}"
511
+ end
512
+ end
513
+
511
514
  def constraints(table_name)
512
515
  query = <<~SQL
513
516
  SELECT
@@ -7,6 +7,8 @@ module StrongMigrations
7
7
  end
8
8
 
9
9
  def method_missing(method, *args)
10
+ return super if is_a?(ActiveRecord::Schema)
11
+
10
12
  strong_migrations_checker.perform(method, *args) do
11
13
  super
12
14
  end
@@ -1,3 +1,3 @@
1
1
  module StrongMigrations
2
- VERSION = "0.7.6"
2
+ VERSION = "0.7.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-01-17 00:00:00.000000000 Z
13
+ date: 2021-06-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord