CREATE TABLE travel_1_trip_comments (
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    trip_id BIGINT UNSIGNED NOT NULL,
    trip_day_id BIGINT UNSIGNED NULL,
    trip_day_item_id BIGINT UNSIGNED NULL,
    user_id BIGINT UNSIGNED NOT NULL,
    body TEXT NOT NULL,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (id),
    KEY idx_trip_comments_trip (trip_id),
    KEY idx_trip_comments_day (trip_day_id),
    KEY idx_trip_comments_item (trip_day_item_id),
    CONSTRAINT fk_trip_comments_trip FOREIGN KEY (trip_id) REFERENCES travel_1_trips(id) ON DELETE CASCADE,
    CONSTRAINT fk_trip_comments_day FOREIGN KEY (trip_day_id) REFERENCES travel_1_trip_days(id) ON DELETE CASCADE,
    CONSTRAINT fk_trip_comments_item FOREIGN KEY (trip_day_item_id) REFERENCES travel_1_trip_day_items(id) ON DELETE CASCADE,
    CONSTRAINT fk_trip_comments_user FOREIGN KEY (user_id) REFERENCES travel_1_users(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
