-- Create table for storing multiple images per member
CREATE TABLE IF NOT EXISTS `member_image` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `member_id` INT NOT NULL,
    `file_name` VARCHAR(255) NOT NULL,
    `sort_order` INT NOT NULL DEFAULT 0,
    `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`),
    INDEX `idx_member_image_member_id` (`member_id`),
    CONSTRAINT `fk_member_image_member`
        FOREIGN KEY (`member_id`)
        REFERENCES `member` (`id`)
        ON DELETE CASCADE
        ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

