-
Notifications
You must be signed in to change notification settings - Fork 6
Add "create table" for MySQL #8
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
base: master
Are you sure you want to change the base?
Conversation
Add create table for MySQL
krombel
left a comment
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.