-- Migration: Add airlines table and update tours table
-- Run this file to add the new airline features

USE tour_management;

-- Add airline_id and return_date columns to tours table
ALTER TABLE tours
ADD COLUMN airline_id INT AFTER sub_category_id,
ADD COLUMN return_date DATE AFTER tour_date;

-- Add foreign key constraint for airline_id
ALTER TABLE tours
ADD CONSTRAINT fk_tours_airline
FOREIGN KEY (airline_id) REFERENCES airlines(id) ON DELETE SET NULL;

-- Verify the changes
DESCRIBE tours;
