Annotation: unit_tests.create_dummy_cost_centers

CREATE OR REPLACE FUNCTION unit_tests.create_dummy_cost_centers()
RETURNS void

Information: unit_tests.create_dummy_cost_centers

Schema unit_tests
Function Name create_dummy_cost_centers
Arguments
Owner postgres
Result Type void
Description

Implementation: unit_tests.create_dummy_cost_centers

CREATE OR REPLACE FUNCTION unit_tests.create_dummy_cost_centers()
 RETURNS void
 LANGUAGE plpgsql
AS $function$
BEGIN
    IF NOT EXISTS(SELECT 1 FROM office.cost_centers WHERE cost_center_code='dummy-cs01') THEN        
        INSERT INTO office.cost_centers(cost_center_code, cost_center_name)
        SELECT 'dummy-cs01', 'Test Mock Cost Center';
    END IF;

    RETURN;
END
$function$