I am trying to modify the table structureorders
CREATE TABLE `orders` (
`idOrder` int UNSIGNED NOT NULL,
`data` mediumtext CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL,
`addedDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`idSalesRep` int UNSIGNED NOT NULL DEFAULT '0',
`status` enum('pending','confirmed','closed','cancelled') CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL DEFAULT 'pending',
`idWarehouse` tinyint UNSIGNED NOT NULL,
`idCustomer` mediumint UNSIGNED NOT NULL,
`idUser` int UNSIGNED NOT NULL,
`idCompany` tinyint UNSIGNED NOT NULL DEFAULT '1',
`idShippingVia` smallint UNSIGNED NOT NULL,
`idDelivery` smallint UNSIGNED NOT NULL,
`updateDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
ALTER TABLE `orders`
ADD PRIMARY KEY (`idOrder`),
ADD KEY `idSalesRep` (`idSalesRep`),
ADD KEY `idWarehouse` (`idWarehouse`),
ADD KEY `idCustomer` (`idCustomer`),
ADD KEY `status` (`status`),
ADD KEY `idUser` (`idUser`),
ADD KEY `idCompany` (`idCompany`),
ADD KEY `idShippingVia` (`idShippingVia`),
ADD KEY `idDelivery` (`idDelivery`);
ALTER TABLE `orders`
MODIFY `idOrder` int UNSIGNED NOT NULL AUTO_INCREMENT;
When I try to execute a modification to the structure
ALTER TABLE `orders`
ADD `partialShipment` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' AFTER `updateDate`,
ADD `partialShipMin` SMALLINT UNSIGNED NOT NULL DEFAULT '0' AFTER `partialShipment`,
ADD `partialShipQty` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `partialShipMin`,
ADD INDEX (`partialShipment`);
I get the following error message:
mysql #1034 - Incorrect key file for table 'orders'; try to repair it
I already tried:
ANALYZE TABLE
orders
;
db_name.orders analyze status OK
CHECKTABLE
orders
;
db_name.orders check status OK
OPTIMIZETABLE
orders
;
db_name.orders optimize note Table does not support optimize, doing recreate + analyze instead
db_name.orders optimize status OK
REPAIRTABLE
orders
;
db_name.orders repair note The storage engine for the table doesn't support repair
What can I do to fix the table?