-- NDC Airline Credentials table
CREATE TABLE IF NOT EXISTS `ndc_airline_credentials` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `agency_id` bigint unsigned NOT NULL,
  `airline_code` varchar(10) NOT NULL,
  `api_key` varchar(500) DEFAULT '',
  `api_secret` varchar(500) DEFAULT '',
  `is_test_mode` tinyint(1) DEFAULT 1,
  `is_active` tinyint(1) DEFAULT 1,
  `last_sync` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `agency_airline` (`agency_id`, `airline_code`),
  KEY `agency_id` (`agency_id`),
  KEY `airline_code` (`airline_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
