DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1
        FROM pg_type t
        JOIN pg_enum e ON t.oid = e.enumtypid
        WHERE t.typname = 'category_code'
          AND e.enumlabel = 'empty_kandang'
    ) THEN
        ALTER TYPE category_code ADD VALUE 'empty_kandang';
    END IF;
END $$;
