-- H202 highway freight operating vehicle ownership. -- Safe to run on an existing MySQL 5.7 database. CREATE TABLE IF NOT EXISTS h202_freight_vehicle_ownership ( id BIGINT AUTO_INCREMENT PRIMARY KEY, report_period VARCHAR(20) NOT NULL COMMENT 'Report period yyyy-MM', region_name VARCHAR(50) NOT NULL COMMENT 'Hubei province or prefecture-level region', report_date DATE NOT NULL COMMENT 'Report date from cell L3', item_code VARCHAR(10) NOT NULL COMMENT 'H202 indicator code 01-93', item_name VARCHAR(200) NOT NULL COMMENT 'Indicator name inherited from the matrix row', unit VARCHAR(20) NULL COMMENT 'Measurement unit', total_value DECIMAL(30,15) NULL, individual_value DECIMAL(30,15) NULL, large_value DECIMAL(30,15) NULL, large_heavy_value DECIMAL(30,15) NULL, large_heavy_individual_value DECIMAL(30,15) NULL, large_individual_value DECIMAL(30,15) NULL, medium_value DECIMAL(30,15) NULL, medium_individual_value DECIMAL(30,15) NULL, small_value DECIMAL(30,15) NULL, small_individual_value DECIMAL(30,15) NULL, source_file_name VARCHAR(255) NULL COMMENT 'Source workbook file name', import_batch_id BIGINT NULL COMMENT 'Import batch id', created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE KEY uk_h202_period_region_item (report_period, region_name, item_code), KEY idx_h202_period_region (report_period, region_name) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='H202 highway freight operating vehicle ownership';