CREATE TABLE complex_rooms_attribute (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    complex_room_id BIGINT UNSIGNED NOT NULL,
    attribute_type ENUM('bathroom', 'loggia', 'balcony', 'room') NOT NULL,
    area DECIMAL(10,2) DEFAULT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    CONSTRAINT fk_room FOREIGN KEY (room_id) REFERENCES complex_rooms(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;



ALTER TABLE clients_dop_info
ADD COLUMN persone_info_bank TEXT
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci
COMMENT 'Реквизиты банка';




ALTER TABLE complex_rooms
ADD COLUMN total_area_excl_living DECIMAL(8,2) DEFAULT NULL COMMENT 'Общая площадь без жилой',
ADD COLUMN total_bathroom_area DECIMAL(8,2) DEFAULT NULL COMMENT 'Общая площадь санузлов',
ADD COLUMN total_balcony_loggia_area DECIMAL(8,2) DEFAULT NULL COMMENT 'Общая площадь лоджий/балконов';
