CREATE TABLE channel_donation_message
(
    id                 BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'PK',
    member_id          BIGINT     NOT NULL COMMENT '후원한 유저',
    creator_id         BIGINT     NOT NULL COMMENT '후원 받은 채널 크리에이터',
    can                INT        NOT NULL COMMENT '후원한 캔',
    is_secret          TINYINT(1) NOT NULL DEFAULT 0 COMMENT '비밀후원 여부(false=0, true=1)',
    additional_message TEXT       NULL COMMENT '추가 메시지',
    created_at         TIMESTAMP  NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '생성 시각',
    updated_at         TIMESTAMP  NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정 시각',
    PRIMARY KEY (id),
    KEY idx_channel_donation_message_creator_created_at (creator_id, created_at),
    KEY idx_channel_donation_message_member (member_id),
    CONSTRAINT fk_channel_donation_message_member
        FOREIGN KEY (member_id) REFERENCES member (id),
    CONSTRAINT fk_channel_donation_message_creator
        FOREIGN KEY (creator_id) REFERENCES member (id)
) COMMENT ='채널 후원 메시지';
