CREATE TABLE user_division_visibility (
    user_id BIGINT NOT NULL REFERENCES users (id) ON DELETE CASCADE,
    division_code VARCHAR(64) NOT NULL,
    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
    PRIMARY KEY (user_id, division_code)
);

CREATE INDEX idx_user_division_visibility_code ON user_division_visibility (division_code);
