pg_ha_migrations 1.2.0 → 1.2.1

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: 36546429641ce670fa116d251f17993538b3ab60b5014c1917103e45b1fa0f45
4
- data.tar.gz: 969078be676bc767aa8f325328da8aeda95b6120e620c5d8556bda639c94a3f4
3
+ metadata.gz: 3ba2e39be712f465020f4518397ebd96270be66b8d11ba4232331214b5d97caa
4
+ data.tar.gz: 446383bfbb83be23757942d26ce711d12b86d226d68d77a04b07baf5290c9976
5
5
  SHA512:
6
- metadata.gz: d2ee13eed929c6278cf745b6b4e4ecff210858e930f97be67d0db2ff4bd2efc65288cc2c80090343cb6cc3e2097c8e1fcf62955fddf442eced723660793706df
7
- data.tar.gz: d1f0853d0d47774e889835716f6619097f3e56016e8997a7115e31c34e87dfc80b0871eee128161f4583247265afbfd9aeae752312dad4bb11a5dd5bf0946184
6
+ metadata.gz: c89e505167d1741fd58e151a600cb76873b9f5819b5c5ea83c57e81d8c005ab68081113d0e02d0a04806c60af41beaf65f4ca1799d76603982dfb0115c7d8747
7
+ data.tar.gz: 51a0f3c9a0a085885792e23a7eecc1b54f56166e4c0af80dc7e163f1da7e0214d128e7c093e441e8a2170b3c071ac9acf44f4eb2499924256e663d0ac72b9359
@@ -66,6 +66,8 @@ module PgHaMigrations::SafeStatements
66
66
  # - If the column is text-like or binary, then we can allow anything in the default
67
67
  # value since a Ruby string there will always coerce directly to the equivalent
68
68
  # text/binary value rather than being interpreted as a DDL-time expression.
69
+ # - Custom enum types are a special case: they also are treated like strings by
70
+ # Rails, so we want to allow those as-is.
69
71
  # - Otherwise, disallow any Ruby string values and instead require the Ruby object
70
72
  # type that maps to the column type.
71
73
  #
@@ -78,7 +80,7 @@ module PgHaMigrations::SafeStatements
78
80
  (
79
81
  connection.quote_default_expression(default_value, column) == "NULL" ||
80
82
  (
81
- ![:string, :text, :binary].include?(column.sql_type_metadata.type) &&
83
+ ![:string, :text, :binary, :enum].include?(column.sql_type_metadata.type) &&
82
84
  default_value.is_a?(String)
83
85
  )
84
86
  )
@@ -1,3 +1,3 @@
1
1
  module PgHaMigrations
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_ha_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - celeen