-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
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
feat: Add InnoDB engine to migration create table methods #745
Conversation
Add the attribute only when using MySQL.
https://github.com/codeigniter4/shield/actions/runs/4989110786/jobs/8932607159?pr=745 |
['ENGINE' => 'InnoDB'] has been restricted to MySQLi platform only. |
src/Database/Migrations/2020-12-28-223112_create_auth_tables.php
Outdated
Show resolved
Hide resolved
$authConfig = config('Auth'); | ||
$this->tables = $authConfig->tables; | ||
$this->ifNotExists = false; | ||
$this->attributes = ($this->db->getPlatform() === 'MySQLi') ? ['ENGINE' => 'InnoDB'] : []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kenjis , as far as I know, MySQLi, OCI8, Postgre and SQLSRV accept the attributes ['ENGINE' => 'InnoDB']
.
And only SQLite3
does not understand ['ENGINE' => 'InnoDB']
. Isn't it better to act as follows?
$this->attributes = ($this->db->getPlatform() === 'SQLite3') ? [] : ['ENGINE' => 'InnoDB'];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. InnoDB
(and ENGINE
) is configration only in MySQL.
I believe OCI8, Postgre and SQLSRV does not understand the attribute.
I don't know why these drivers do not report an error like SQLite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it will stay like i did it, e.g. restricted to MySQL only!
src/Database/Migrations/2020-12-28-223112_create_auth_tables.php
Outdated
Show resolved
Hide resolved
@kpeu3u Thank you! |
resolved: #741