We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.1
4.3.1
Composer (using codeigniter4/appstarter)
codeigniter4/appstarter
Linux
apache
MySql 8
When trying to add a primary key to an existing table, it does not work:
$this->forge->addPrimaryKey('id', 'pk_actions'); $this->forge->processIndexes('actions');
Create a migration to add a primary key to an existing table with the following rows:
Primary key should be added.
The problem seems to lie in the processIndexes() function as it only processes primary keys when a non primary key is added:
processIndexes()
if (! empty($this->keys)) { $sqls = $this->_processIndexes($this->db->DBPrefix . $table, true); $pk = $this->_processPrimaryKeys($table, true); if ($pk !== '') { $sqls[] = $pk; } }
The text was updated successfully, but these errors were encountered:
Thank you for reporting. Try #8031
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
PHP Version
8.1
CodeIgniter4 Version
4.3.1
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
MySql 8
What happened?
When trying to add a primary key to an existing table, it does not work:
Steps to Reproduce
Create a migration to add a primary key to an existing table with the following rows:
Expected Output
Primary key should be added.
Anything else?
The problem seems to lie in the
processIndexes()
function as it only processes primary keys when a non primary key is added:The text was updated successfully, but these errors were encountered: