CREATE TABLE IF NOT EXISTS travel_1_trip_private_notes (
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    trip_id BIGINT UNSIGNED NOT NULL,
    user_id BIGINT UNSIGNED NOT NULL,
    title VARCHAR(255) 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_private_notes_trip_user (trip_id,user_id),
    CONSTRAINT fk_trip_private_notes_trip FOREIGN KEY (trip_id)
        REFERENCES travel_1_trips(id) ON DELETE CASCADE,
    CONSTRAINT fk_trip_private_notes_user FOREIGN KEY (user_id)
        REFERENCES travel_1_users(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
