You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
basically I expected to see something like in the debug ALTER TABLE 'books_words' ADD PRIMARY KEY( 'word_id', 'book_id');
Actual Behavior
The update function did not take into account the "primaryKey" attribute, I added a column just to test if it was working properly and found that the column is added but no primary key is added
(log at https://gist.github.com/Josexato/aa9f8d11ea331b78ad72dfa17725c43c)
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
CakePHP Version: 3.5.10
Migrations plugin version: 1.7.2
Bake plugin version (if relevant): 1.6.0
Database server (MySQL, SQLite, Postgres): 5.7.20-0ubuntu0.16.04.1
PHP Version: PHP 7.0.22-0ubuntu0.16.04.1
Platform / OS: ubuntu0.16.04.1
What you did
I wanted to add a primary key composed by two columns so I created this
$this->table('books_words')->addPrimaryKey(['books_id','word_id'])->update();
(full code at https://github.com/Josexato/cakephp_sandbox/blob/ac1edbbf26ebcd16508497adcfe3c105b6cf3967/config/Migrations/20180108172304_AddedPrimaryKeys.php#L11)
Expected Behavior
basically I expected to see something like in the debug
ALTER TABLE 'books_words' ADD PRIMARY KEY( 'word_id', 'book_id');
Actual Behavior
The update function did not take into account the "primaryKey" attribute, I added a column just to test if it was working properly and found that the column is added but no primary key is added
(log at https://gist.github.com/Josexato/aa9f8d11ea331b78ad72dfa17725c43c)
I've looked for a functions among the adapters that does somthing the "primaryKey" attribute and I've only found this https://github.com/cakephp/phinx/blame/master/src/Phinx/Db/Adapter/MysqlAdapter.php#L264 in the "createTable()" but no action is taken for update and "primaryKey".
The text was updated successfully, but these errors were encountered: