I have the following code:
use Phinx\Migration\AbstractMigration;
class CreateNewTableForJobListLanguages extends AbstractMigration
{
/**
* Migrate up.
*/
public function up()
{
$this->execute('
CREATE TABLE `v2_joblist_languages` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`joblist_id` int(11) NULL,
`language_id` int(11) NULL,
FOREIGN KEY (`joblist_id`) REFERENCES `v2_job_alerts` (`id`),
FOREIGN KEY (`language_id`) REFERENCES `v2_languages` (`id`))
');
}
When trying to migrate, I get the following error:
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key
Broke my head trying to solve it, and understand why is it happening. Grateful for any assistance, thanks in advance.