dynamic_migrations 3.8.5 → 3.8.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00405e194209e083433ebb55aa305922a16e24290ead4f240420602c9465bc90
|
4
|
+
data.tar.gz: 57b7136d7eb1f7efc5382101cf24a4dc5ed4852e66a5f67faf368294e05632c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc594cb118caa67c0e9982f839c762e074b789b083328a1b69b3261297bd34055a53739f51cabb6f6e5685ea76f80eb4574b45649fd202bf213a579713842fac
|
7
|
+
data.tar.gz: 8d42ee7274c26e25086eae4e9c2646f958f930a18fd03eb9c6262f734cf55af380499763e3508a05156a6f1baad4c7bc30007e9d242674d9594bf83e75a7bf1f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [3.8.6](https://github.com/craigulliott/dynamic_migrations/compare/v3.8.5...v3.8.6) (2023-10-08)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* replacing enum casts with the temporary enums when normalizing check clause and action conditions ([0cb67fc](https://github.com/craigulliott/dynamic_migrations/commit/0cb67fcff4d7833ec1dd60453526b1bc3dbe45ee))
|
9
|
+
|
3
10
|
## [3.8.5](https://github.com/craigulliott/dynamic_migrations/compare/v3.8.4...v3.8.5) (2023-10-08)
|
4
11
|
|
5
12
|
|
@@ -224,6 +224,13 @@ module DynamicMigrations
|
|
224
224
|
$$ BEGIN END $$;
|
225
225
|
SQL
|
226
226
|
|
227
|
+
temp_action_condition = action_condition
|
228
|
+
# string replace any real enum names with their temp enum names
|
229
|
+
temp_enums.each do |temp_enum_name, enum|
|
230
|
+
temp_action_condition.gsub!("::#{enum.name}", "::#{temp_enum_name}")
|
231
|
+
temp_action_condition.gsub!("::#{enum.full_name}", "::#{temp_enum_name}")
|
232
|
+
end
|
233
|
+
|
227
234
|
# create a temporary trigger, from which we will fetch the normalized action condition
|
228
235
|
connection.exec(<<~SQL)
|
229
236
|
CREATE TRIGGER trigger_normalized_action_condition_temp_trigger
|
@@ -134,9 +134,16 @@ module DynamicMigrations
|
|
134
134
|
|
135
135
|
temp_enums = table.create_temp_table(connection, "validation_normalized_check_clause_temp_table")
|
136
136
|
|
137
|
+
temp_check_clause = check_clause
|
138
|
+
# string replace any real enum names with their temp enum names
|
139
|
+
temp_enums.each do |temp_enum_name, enum|
|
140
|
+
temp_check_clause.gsub!("::#{enum.name}", "::#{temp_enum_name}")
|
141
|
+
temp_check_clause.gsub!("::#{enum.full_name}", "::#{temp_enum_name}")
|
142
|
+
end
|
143
|
+
|
137
144
|
connection.exec(<<~SQL)
|
138
145
|
ALTER TABLE validation_normalized_check_clause_temp_table
|
139
|
-
ADD CONSTRAINT #{name} CHECK (#{
|
146
|
+
ADD CONSTRAINT #{name} CHECK (#{temp_check_clause})
|
140
147
|
SQL
|
141
148
|
|
142
149
|
# get the normalized version of the constraint
|