Skip to content

Conversation

@jasmir
Copy link

@jasmir jasmir commented Feb 23, 2019

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.

Add create table for MySQL
Copy link
Owner

@krombel krombel left a 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");
Copy link
Owner

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

Copy link
Author

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 (
Copy link
Owner

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

Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants