strong_migrations 0.7.6 → 0.7.7
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/CHANGELOG.md +4 -0
- data/lib/strong_migrations/checker.rb +10 -7
- data/lib/strong_migrations/migration.rb +2 -0
- data/lib/strong_migrations/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de58409c64c5050d99432576f5d38f615de75832de7214960f9f686248bfa31c
|
4
|
+
data.tar.gz: d6113e7875c2b0f75e4548117692af874ffa12d7ebea731ed94344069661399d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23655309809f41dbe53842ee01ac8f573153ed49936f003bef0076591ec26f2bff7464c32fbf35ca8e2037e2eb8227c0e6c12b2e8c609e9cd05ccd6127474620
|
7
|
+
data.tar.gz: 501307d37d8577552735553b0e4b6f96f9afa415d3ed5737a06f16c44227ad7996daea70a9b2a480303678135c45806c410eacce03e125a92c2929b531bbdb34
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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"] ||
|
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
|
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.
|
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-
|
13
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|