-- ============================================
-- Schema diff: DEV -> TEST
-- Wygenerowano przez schema_diff.py
-- ============================================

-- --------------------------------------------
-- NOWE TABELE (1)
-- --------------------------------------------

-- Tabela: contract_cruise_program
CREATE TABLE `contract_cruise_program` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `contract_id` int(11) NOT NULL,
  `point_order` int(11) NOT NULL,
  `travel_day` int(11) NOT NULL,
  `travel_place_name` varchar(255) DEFAULT NULL,
  `country_name` varchar(255) DEFAULT NULL,
  `arrival_time` varchar(16) DEFAULT NULL,
  `departure_time` varchar(16) DEFAULT NULL,
  `point_description` text DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_contract_cruise_program_contract` (`contract_id`),
  KEY `idx_contract_cruise_program_order` (`contract_id`,`point_order`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------
-- NOWE KOLUMNY (25)
-- --------------------------------------------

-- cabin_capacities.capacity
ALTER TABLE `cabin_capacities` ADD COLUMN `capacity` int(11) DEFAULT NULL AFTER `id`;

-- cabin_types_l18n.short_name
ALTER TABLE `cabin_types_l18n` ADD COLUMN `short_name` varchar(50) DEFAULT NULL AFTER `name`;

-- contract_advances.contract_item_id
ALTER TABLE `contract_advances` ADD COLUMN `contract_item_id` int(11) DEFAULT NULL AFTER `contract_id`;

-- contract_advances_history.contract_item_id
ALTER TABLE `contract_advances_history` ADD COLUMN `contract_item_id` int(11) DEFAULT NULL AFTER `contract_id`;

-- contract_cabins.cabin_order
ALTER TABLE `contract_cabins` ADD COLUMN `cabin_order` int(11) DEFAULT NULL AFTER `description`;

-- contract_cabins_history.cabin_order
ALTER TABLE `contract_cabins_history` ADD COLUMN `cabin_order` int(11) DEFAULT NULL AFTER `description`;

-- contract_item_types.icon
ALTER TABLE `contract_item_types` ADD COLUMN `icon` varchar(100) DEFAULT NULL AFTER `merge_type`;

-- contract_item_types.show_in_contract
ALTER TABLE `contract_item_types` ADD COLUMN `show_in_contract` tinyint(1) NOT NULL DEFAULT 1 AFTER `icon`;

-- contract_item_types_l18n.short_name
ALTER TABLE `contract_item_types_l18n` ADD COLUMN `short_name` varchar(100) DEFAULT NULL AFTER `name`;

-- contract_items.item_order
ALTER TABLE `contract_items` ADD COLUMN `item_order` int(11) DEFAULT NULL AFTER `description`;

-- contract_items.contract_cabin_id
ALTER TABLE `contract_items` ADD COLUMN `contract_cabin_id` int(11) DEFAULT NULL AFTER `item_order`;

-- contract_items_history.item_order
ALTER TABLE `contract_items_history` ADD COLUMN `item_order` int(11) DEFAULT NULL AFTER `description`;

-- contract_items_history.contract_cabin_id
ALTER TABLE `contract_items_history` ADD COLUMN `contract_cabin_id` int(11) DEFAULT NULL AFTER `item_order`;

-- contract_participants.cabin_id
ALTER TABLE `contract_participants` ADD COLUMN `cabin_id` int(11) DEFAULT NULL AFTER `client_id`;

-- contract_participants.participant_order
ALTER TABLE `contract_participants` ADD COLUMN `participant_order` int(11) DEFAULT NULL AFTER `cabin_id`;

-- contract_participants_history.cabin_id
ALTER TABLE `contract_participants_history` ADD COLUMN `cabin_id` int(11) DEFAULT NULL AFTER `client_id`;

-- contract_participants_history.participant_order
ALTER TABLE `contract_participants_history` ADD COLUMN `participant_order` int(11) DEFAULT NULL AFTER `cabin_id`;

-- contracts.cruise_ship_name
ALTER TABLE `contracts` ADD COLUMN `cruise_ship_name` varchar(255) DEFAULT NULL AFTER `ship_id`;

-- contracts.cruise_shipowner_name
ALTER TABLE `contracts` ADD COLUMN `cruise_shipowner_name` varchar(255) DEFAULT NULL AFTER `cruise_ship_name`;

-- contracts.cruise_shipowner_short
ALTER TABLE `contracts` ADD COLUMN `cruise_shipowner_short` varchar(64) DEFAULT NULL AFTER `cruise_shipowner_name`;

-- contracts.cruise_shipowner_icon
ALTER TABLE `contracts` ADD COLUMN `cruise_shipowner_icon` varchar(255) DEFAULT NULL AFTER `cruise_shipowner_short`;

-- contracts_history.cruise_ship_name
ALTER TABLE `contracts_history` ADD COLUMN `cruise_ship_name` varchar(255) DEFAULT NULL AFTER `ship_id`;

-- contracts_history.cruise_shipowner_name
ALTER TABLE `contracts_history` ADD COLUMN `cruise_shipowner_name` varchar(255) DEFAULT NULL AFTER `cruise_ship_name`;

-- contracts_history.cruise_shipowner_short
ALTER TABLE `contracts_history` ADD COLUMN `cruise_shipowner_short` varchar(64) DEFAULT NULL AFTER `cruise_shipowner_name`;

-- contracts_history.cruise_shipowner_icon
ALTER TABLE `contracts_history` ADD COLUMN `cruise_shipowner_icon` varchar(255) DEFAULT NULL AFTER `cruise_shipowner_short`;

-- --------------------------------------------
-- ZMIENIONE KOLUMNY (1)
-- --------------------------------------------

-- contracts.brocker_id
ALTER TABLE `contracts` MODIFY COLUMN `brocker_id` int(11) DEFAULT NULL;
