strong_migrations 0.7.5 → 0.7.6

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: 2361d565fefd198370b908622526d01c4b5052f5361947c6410d1176b21b20a9
4
- data.tar.gz: c9ee9a7b444980b957f60dbb09290a5296a94e9f121af6b1d83756b2645ab54e
3
+ metadata.gz: f16481df30c6b961477b4a537034097aa1d41a262bd7f2741c40b7e6dae9cb9e
4
+ data.tar.gz: 816bc9a4f9810bce6ac6d5e0a52b185800515794ca5e3d27b5f4d512a9190115
5
5
  SHA512:
6
- metadata.gz: ca57e53122e37d7674143a48a5699bacf07f07f3c638abbf71331a3c4686a1e08f4f1fa02160e99ea0e21ed3a811aa43dc11581143b0229f5201ddc335fd792b
7
- data.tar.gz: 4b760e24cda9a14efed64300992645ec9e4b207bbafb5210bdfd2195764980cc0ab08ebbd6693aac6518d5302da918a74e20d5d282d654700efe89e4a8418a63
6
+ metadata.gz: 2ac9f7c38958c1cc2e80efa3f895730087ac92a3675be31c308f9f8df827ced3323ca8bc3e69c99e2a79b92ef0a5a8b595a76715bf55c45b5698fcdd43b5a586
7
+ data.tar.gz: 2cee8d3013ae8780f0bcbce33f22a219375c29f059335902cdfe2285ec557307229b7ec4544e6be59ea1ee7cd039f2b23e9b3693efc41f11f677cbbed1495896
@@ -1,3 +1,8 @@
1
+ ## 0.7.6 (2021-01-17)
2
+
3
+ - Fixed `NOT NULL` constraint check for quoted columns
4
+ - Fixed deprecation warning with Active Record 6.1
5
+
1
6
  ## 0.7.5 (2021-01-12)
2
7
 
3
8
  - Added checks for `add_check_constraint` and `validate_check_constraint`
data/README.md CHANGED
@@ -656,8 +656,6 @@ Certain methods like `execute` and `change_table` cannot be inspected and are pr
656
656
 
657
657
  ## Safe by Default
658
658
 
659
- *Experimental*
660
-
661
659
  Make operations safe by default.
662
660
 
663
661
  - adding and removing an index
@@ -31,7 +31,11 @@ module StrongMigrations
31
31
  end
32
32
 
33
33
  def adapter
34
- ActiveRecord::Base.connection_config[:adapter].to_s
34
+ if ActiveRecord::VERSION::STRING.to_f >= 6.1
35
+ ActiveRecord::Base.connection_db_config.adapter.to_s
36
+ else
37
+ ActiveRecord::Base.connection_config[:adapter].to_s
38
+ end
35
39
  end
36
40
 
37
41
  def postgresql?
@@ -219,8 +219,7 @@ Then add the foreign key in separate migrations."
219
219
  if postgresql?
220
220
  safe = false
221
221
  if postgresql_version >= Gem::Version.new("12")
222
- # TODO likely need to quote the column in some situations
223
- safe = constraints(table).any? { |c| c["def"] == "CHECK ((#{column} IS NOT NULL))" }
222
+ safe = constraints(table).any? { |c| c["def"] == "CHECK ((#{column} IS NOT NULL))" || c["def"] == "CHECK ((#{connection.quote_column_name(column)} IS NOT NULL))" }
224
223
  end
225
224
 
226
225
  unless safe
@@ -1,3 +1,3 @@
1
1
  module StrongMigrations
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.6"
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.5
4
+ version: 0.7.6
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-13 00:00:00.000000000 Z
13
+ date: 2021-01-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord