I created a new Migration script on CakePHP 3 using the following command
bin/cake bake migration CreateOfficialTeams id:int name:string topic_id:int
The id
field should be the primary key, and topic_id
is a foreign key. The script comes out like I want, except topic_id
is a string for some reason, but I manually fix that.
When I attempt to run the script I get an error stating:
Exception: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'id' in [/home/bradygp/workspace/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php, line 306]
2017-02-27 21:52:16 Error [PDOException] SQLSTATE[45S21]: Column already exists: 1060 Duplicate column name 'id'
I have other tables with a column name of 'id', but this is a new table, called with the create()
function,