feat: Add InnoDB engine to migration create table methods#745
feat: Add InnoDB engine to migration create table methods#745datamweb merged 4 commits intocodeigniter4:developfrom
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.
@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.
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.
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