Fixed line endings in schema.sql

This commit is contained in:
Erza
2026-03-19 18:38:04 +00:00
parent 541b5d1a10
commit 506dd29584
+20 -20
View File
@@ -1,32 +1,32 @@
CREATE OR REPLACE FUNCTION public.insert_into_exercises()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
DECLARE
new_exercise_id BIGINT;
BEGIN
-- Insert a new row into the exercises table
INSERT INTO exercises (created_at, updated_at, category)
VALUES (NOW(), NOW(), 'click')
RETURNING id INTO new_exercise_id;
-- Link the new exercise to the click_exercises entry
INSERT INTO click_to_exercises (click_id, exercise_id, created_at, updated_at)
VALUES (NEW.id, new_exercise_id, NOW(), NOW());
RETURN NEW;
END;
AS $function$
DECLARE
new_exercise_id BIGINT;
BEGIN
-- Insert a new row into the exercises table
INSERT INTO exercises (created_at, updated_at, category)
VALUES (NOW(), NOW(), 'click')
RETURNING id INTO new_exercise_id;
-- Link the new exercise to the click_exercises entry
INSERT INTO click_to_exercises (click_id, exercise_id, created_at, updated_at)
VALUES (NEW.id, new_exercise_id, NOW(), NOW());
RETURN NEW;
END;
$function$
;
CREATE OR REPLACE FUNCTION public.updated_at()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
AS $function$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$function$
;