2023-04-28 20:43:58 +00:00
|
|
|
##########
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION "category_types_after_update"() RETURNS TRIGGER AS $category_types_after_update$
|
|
|
|
BEGIN
|
|
|
|
INSERT INTO "category_types_history"("action", "original_id", "description", "editor", "status", "sort_order", "queued_at", "created_at", "updated_at", "payload")
|
2023-05-01 07:22:25 +00:00
|
|
|
VALUES('update', OLD."id", OLD."description", OLD."editor", OLD."status", OLD."sort_order", OLD."queued_at", OLD."created_at", OLD."updated_at", OLD."payload");
|
|
|
|
RETURN NEW;
|
2023-04-28 20:43:58 +00:00
|
|
|
END;
|
|
|
|
$category_types_after_update$ LANGUAGE plpgsql;
|
|
|
|
|
|
|
|
##########
|
|
|
|
|
2023-05-01 07:22:25 +00:00
|
|
|
CREATE OR REPLACE TRIGGER "category_types_after_update_trigger" BEFORE UPDATE ON "category_types"
|
2023-04-28 20:43:58 +00:00
|
|
|
FOR EACH ROW EXECUTE FUNCTION "category_types_after_update"();
|
|
|
|
|
|
|
|
##########
|
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION "category_types_after_delete"() RETURNS TRIGGER AS $category_types_after_delete$
|
|
|
|
BEGIN
|
|
|
|
INSERT INTO "category_types_history"("action", "original_id", "description", "editor", "status", "sort_order", "queued_at", "created_at", "updated_at", "payload")
|
2023-05-01 07:22:25 +00:00
|
|
|
VALUES('delete', OLD."id", OLD."description", OLD."editor", OLD."status", OLD."sort_order", OLD."queued_at", OLD."created_at", OLD."updated_at", OLD."payload");
|
|
|
|
RETURN OLD;
|
2023-04-28 20:43:58 +00:00
|
|
|
END;
|
|
|
|
$category_types_after_delete$ LANGUAGE plpgsql;
|
|
|
|
|
|
|
|
##########
|
|
|
|
|
2023-05-01 07:22:25 +00:00
|
|
|
CREATE OR REPLACE TRIGGER "category_types_after_delete_trigger" BEFORE DELETE ON "category_types"
|
2023-04-28 20:43:58 +00:00
|
|
|
FOR EACH ROW EXECUTE FUNCTION "category_types_after_delete"();
|
2022-10-31 10:49:21 +00:00
|
|
|
|
2023-05-01 07:22:25 +00:00
|
|
|
##########
|