-- +goose Up
-- +goose StatementBegin
DECLARE
    v_count NUMBER;
BEGIN
    SELECT COUNT(*) INTO v_count FROM user_sequences WHERE sequence_name = 'SEQ_TB_FLASH_FATO_PERDA';
    IF v_count = 0 THEN
        EXECUTE IMMEDIATE 'CREATE SEQUENCE SEQ_TB_FLASH_FATO_PERDA START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE';
    END IF;
END;
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
DECLARE
    v_count NUMBER;
BEGIN
    SELECT COUNT(*) INTO v_count FROM user_sequences WHERE sequence_name = 'SEQ_TB_FLASH_FATO_PERDA';
    IF v_count > 0 THEN
        EXECUTE IMMEDIATE 'DROP SEQUENCE SEQ_TB_FLASH_FATO_PERDA';
    END IF;
END;
-- +goose StatementEnd
