I'm a new Magento user and am trying to add a unique database index based on 2 columns to a custom database table using UpgradeSchema.php. The table already exists as do the columns I'm indexing. Here is my code portion:
$installer->getConnection()
->addIndex(
$installer->getIdxName(
$installer->getTable('ds_runs'),
['date_delivery', 'run'],
AdapterInterface::INDEX_TYPE_UNIQUE
),
['date_delivery', 'run'],
['type' => AdapterInterface::INDEX_TYPE_UNIQUE]
);
The error I receive when running setup:upgrade is
Base table or view not found: 1146 Table 'doorstep.ds_runs_date_delivery_run_run_id'
doesn't exist,query was:DESCRIBE `DS_RUNS_DATE_DELIVERY_RUN_RUN_ID`
Don't know what I'm doing wrong here. I can see it's looking for a table based on a concatenation of the table name and the columns I want to index.