Add "create table" for MySQL#8
Conversation
Add create table for MySQL
krombel
left a comment
There was a problem hiding this comment.
Looks good. Thanks for developing that create statement! Looks good from a first view!
Just some comments
| `request_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| PRIMARY KEY (`id`), | ||
| UNIQUE KEY `username` (`username`) | ||
| ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4"); |
There was a problem hiding this comment.
I would not define an ENGINE here - or default to InnoDB as it is transaction-safe. Same below
There was a problem hiding this comment.
I don't know if it is still true, but I learned some time that if you don't need transactions and/or foreign key support use MyISAM because it has the smaller disk-footprint, is faster in most cases (many more reads than writes) and has the better tools for optimizing. There I would prefer MyISAM if there is no need for transactions and/or foreign keys. If there is a need for it, there should InnoDB explicitly selected.
| request_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP | ||
| )"); | ||
| $this->db->exec("CREATE TABLE IF NOT EXISTS logins ( | ||
| $this->db->exec("CREATE TABLE IF NOT EXISTS logins ( |
There was a problem hiding this comment.
This looks like changed indenting. I try to always indent by 4 spaces. I just noticed that I am inconsistent with that as well but I would ask to at least restore the former indentation to reduce diff size
There was a problem hiding this comment.
The "$this->db->exec" are a now substructure of the mysql-check (or the else-branch of this check). So, if I understand it correctly, they have to be indenting, but 4 spaces. Is this correct?
The "create tables" section differs now between "MySQL" and "Other", and populate MySQL with a working table. The distinct row-values still needs to be tuned.