-- Migration: 0007_soft_delete_coverage
-- Purpose: Add deletedAt columns to compliance-critical models
-- Models: Aircraft, Load, Wallet, Transaction, Incident, Booking, PaymentIntent, Rig
-- Reversible: Yes (DROP COLUMN deletedAt + DROP INDEX)

-- Aircraft
ALTER TABLE `aircrafts` ADD COLUMN `deletedAt` DATETIME(3) NULL;
CREATE INDEX `aircrafts_deletedAt_idx` ON `aircrafts`(`deletedAt`);

-- Load
ALTER TABLE `loads` ADD COLUMN `deletedAt` DATETIME(3) NULL;
CREATE INDEX `loads_deletedAt_idx` ON `loads`(`deletedAt`);

-- Wallet
ALTER TABLE `wallets` ADD COLUMN `deletedAt` DATETIME(3) NULL;
CREATE INDEX `wallets_deletedAt_idx` ON `wallets`(`deletedAt`);

-- Transaction
ALTER TABLE `transactions` ADD COLUMN `deletedAt` DATETIME(3) NULL;
CREATE INDEX `transactions_deletedAt_idx` ON `transactions`(`deletedAt`);

-- Incident
ALTER TABLE `incidents` ADD COLUMN `deletedAt` DATETIME(3) NULL;
CREATE INDEX `incidents_deletedAt_idx` ON `incidents`(`deletedAt`);

-- Booking
ALTER TABLE `bookings` ADD COLUMN `deletedAt` DATETIME(3) NULL;
CREATE INDEX `bookings_deletedAt_idx` ON `bookings`(`deletedAt`);

-- PaymentIntent
ALTER TABLE `payment_intents` ADD COLUMN `deletedAt` DATETIME(3) NULL;
CREATE INDEX `payment_intents_deletedAt_idx` ON `payment_intents`(`deletedAt`);

-- Rig
ALTER TABLE `rigs` ADD COLUMN `deletedAt` DATETIME(3) NULL;
CREATE INDEX `rigs_deletedAt_idx` ON `rigs`(`deletedAt`);
