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 +4 -4
- data/lib/pg_ha_migrations/safe_statements.rb +3 -1
- data/lib/pg_ha_migrations/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ba2e39be712f465020f4518397ebd96270be66b8d11ba4232331214b5d97caa
|
4
|
+
data.tar.gz: 446383bfbb83be23757942d26ce711d12b86d226d68d77a04b07baf5290c9976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
)
|