You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -76,6 +76,8 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
76
76
77
77
#{ash_raise_error()}
78
78
79
+
#{ash_required()}
80
+
79
81
#{uuid_generate_v7()}
80
82
"""
81
83
end
@@ -100,6 +102,8 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
100
102
101
103
#{ash_raise_error()}
102
104
105
+
#{ash_required()}
106
+
103
107
#{uuid_generate_v7()}
104
108
105
109
execute(\"\"\"
@@ -134,6 +138,8 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
134
138
"""
135
139
#{ash_raise_error()}
136
140
141
+
#{ash_required()}
142
+
137
143
#{uuid_generate_v7()}
138
144
"""
139
145
end
@@ -142,6 +148,8 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
142
148
"""
143
149
#{ash_raise_error()}
144
150
151
+
#{ash_required()}
152
+
145
153
#{uuid_generate_v7()}
146
154
"""
147
155
end
@@ -150,6 +158,9 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
150
158
"""
151
159
execute("ALTER FUNCTION ash_raise_error(jsonb) STABLE;")
152
160
execute("ALTER FUNCTION ash_raise_error(jsonb, ANYCOMPATIBLE) STABLE")
161
+
162
+
#{ash_required()}
163
+
153
164
#{uuid_generate_v7()}
154
165
"""
155
166
end
@@ -158,39 +169,73 @@ defmodule AshPostgres.MigrationGenerator.AshFunctions do
158
169
"""
159
170
execute("ALTER FUNCTION ash_raise_error(jsonb) STABLE;")
160
171
execute("ALTER FUNCTION ash_raise_error(jsonb, ANYCOMPATIBLE) STABLE")
172
+
173
+
#{ash_required()}
174
+
161
175
#{uuid_generate_v7()}
162
176
"""
163
177
end
164
178
179
+
definstall(5)do
180
+
"""
181
+
#{ash_required()}
182
+
"""
183
+
end
184
+
165
185
defdrop(4)do
166
186
"""
167
187
execute("ALTER FUNCTION ash_raise_error(jsonb) VOLATILE;")
168
188
execute("ALTER FUNCTION ash_raise_error(jsonb, ANYCOMPATIBLE) VOLATILE")
189
+
190
+
execute("DROP FUNCTION IF EXISTS ash_required(ANYCOMPATIBLE, jsonb)")
169
191
"""
170
192
end
171
193
194
+
defdrop(5)do
195
+
"execute(\"DROP FUNCTION IF EXISTS ash_required(ANYCOMPATIBLE, jsonb)\")"
196
+
end
197
+
172
198
defdrop(3)do
173
-
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid)\")"
199
+
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid), ash_required(ANYCOMPATIBLE, jsonb)\")"
174
200
end
175
201
176
202
defdrop(2)do
177
203
"""
178
204
#{ash_raise_error()}
179
205
180
-
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid)\")"
206
+
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid), ash_required(ANYCOMPATIBLE, jsonb)\")"
181
207
"""
182
208
end
183
209
184
210
defdrop(1)do
185
-
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid), ash_raise_error(jsonb), ash_raise_error(jsonb, ANYCOMPATIBLE)\")"
211
+
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid), ash_raise_error(jsonb), ash_raise_error(jsonb, ANYCOMPATIBLE), ash_required(ANYCOMPATIBLE, jsonb)\")"
186
212
end
187
213
188
214
defdrop(0)do
189
-
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid), ash_raise_error(jsonb), ash_raise_error(jsonb, ANYCOMPATIBLE), ash_trim_whitespace(text[])\")"
215
+
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid), ash_raise_error(jsonb), ash_raise_error(jsonb, ANYCOMPATIBLE), ash_trim_whitespace(text[]), ash_required(ANYCOMPATIBLE, jsonb)\")"
190
216
end
191
217
192
218
defdrop(nil)do
193
-
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid), ash_raise_error(jsonb), ash_raise_error(jsonb, ANYCOMPATIBLE), ash_elixir_and(BOOLEAN, ANYCOMPATIBLE), ash_elixir_and(ANYCOMPATIBLE, ANYCOMPATIBLE), ash_elixir_or(ANYCOMPATIBLE, ANYCOMPATIBLE), ash_elixir_or(BOOLEAN, ANYCOMPATIBLE), ash_trim_whitespace(text[])\")"
219
+
"execute(\"DROP FUNCTION IF EXISTS uuid_generate_v7(), timestamp_from_uuid_v7(uuid), ash_raise_error(jsonb), ash_raise_error(jsonb, ANYCOMPATIBLE), ash_elixir_and(BOOLEAN, ANYCOMPATIBLE), ash_elixir_and(ANYCOMPATIBLE, ANYCOMPATIBLE), ash_elixir_or(ANYCOMPATIBLE, ANYCOMPATIBLE), ash_elixir_or(BOOLEAN, ANYCOMPATIBLE), ash_trim_whitespace(text[]), ash_required(ANYCOMPATIBLE, jsonb)\")"
220
+
end
221
+
222
+
defpash_requireddo
223
+
"""
224
+
execute(\"\"\"
225
+
CREATE OR REPLACE FUNCTION ash_required(value ANYCOMPATIBLE, payload jsonb)
0 commit comments