Skip to content

Commit

Permalink
fix: SQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Jan 26, 2025
1 parent 3268624 commit c422f49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION public.check_revert_to_builtin_version(appId character varying)
CREATE OR REPLACE FUNCTION public.check_revert_to_builtin_version(appid character varying)
RETURNS INTEGER
LANGUAGE plpgsql
AS $function$
Expand All @@ -10,15 +10,15 @@ BEGIN
INTO version_id
FROM app_versions
WHERE name = 'revert_to_builtin'
AND appid = appId;
AND app_id = appid;

IF NOT FOUND THEN
INSERT INTO app_versions(name, app_id, storage_provider)
VALUES ('revert_to_builtin', appId, 'revert_to_builtin')
VALUES ('revert_to_builtin', appid, 'revert_to_builtin')
RETURNING id INTO version_id;
END IF;

RETURN version_id;
END;
END;
$function$
$function$
8 changes: 4 additions & 4 deletions supabase/migrations/20241203025232_unique_device_override.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION public.check_revert_to_builtin_version(appId character varying)
CREATE OR REPLACE FUNCTION public.check_revert_to_builtin_version(appid character varying)
RETURNS INTEGER
LANGUAGE plpgsql
AS $function$
Expand All @@ -10,15 +10,15 @@ BEGIN
INTO version_id
FROM app_versions
WHERE name = 'builtin'
AND appid = appId;
AND app_id = appid;

IF NOT FOUND THEN
INSERT INTO app_versions(name, app_id, storage_provider)
VALUES ('builtin', appId, 'r2')
VALUES ('builtin', appid, 'r2')
RETURNING id INTO version_id;
END IF;

RETURN version_id;
END;
END;
$function$
$function$

0 comments on commit c422f49

Please sign in to comment.