CREATE TYPE service.badge_action_type AS ENUM (
    'add',
    'remove'
);

CREATE TABLE IF NOT EXISTS social.badge_meta (
    badge_id text PRIMARY KEY,
    icon bytea
);

CREATE TABLE IF NOT EXISTS service.badge_task (
    id bigint PRIMARY KEY REFERENCES service.task(id),
    action service.badge_action_type NOT NULL,
    badge_id text NOT NULL,
    file bytea,
    result_url text
);
