Skip to content

Commit

Permalink
Rename SQL function
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Jan 22, 2024
1 parent 588eb28 commit 9f2a2a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tiled/catalog/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def unique_parameter_num_null_check(target, connection, **kw):
connection.execute(
text(
"""
CREATE OR REPLACE FUNCTION test_parameter_exists()
CREATE OR REPLACE FUNCTION raise_if_parameter_exists()
RETURNS TRIGGER AS $$
BEGIN
IF EXISTS (
Expand All @@ -217,13 +217,13 @@ def unique_parameter_num_null_check(target, connection, **kw):
BEFORE INSERT ON data_source_asset_association
FOR EACH ROW
WHEN (NEW.num IS NULL)
EXECUTE FUNCTION test_parameter_exists();"""
EXECUTE FUNCTION raise_if_parameter_exists();"""
)
)
connection.execute(
text(
"""
CREATE OR REPLACE FUNCTION test_not_null_parameter_exists()
CREATE OR REPLACE FUNCTION raise_if_null_parameter_exists()
RETURNS TRIGGER AS $$
BEGIN
IF EXISTS (
Expand All @@ -247,7 +247,7 @@ def unique_parameter_num_null_check(target, connection, **kw):
BEFORE INSERT ON data_source_asset_association
FOR EACH ROW
WHEN (NEW.num IS NOT NULL)
EXECUTE FUNCTION test_not_null_parameter_exists();"""
EXECUTE FUNCTION raise_if_null_parameter_exists();"""
)
)

Expand Down

0 comments on commit 9f2a2a3

Please sign in to comment.