Skip to content
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

Use "if not exists" when trying to create table #14886

Merged
merged 1 commit into from Sep 11, 2019

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Sep 11, 2019

This can avoid some error logs depending on the used database adapter etc. In theory we can then remove catching the error a few lines below but should be fine to keep it as well.

If not exists should be safe to use, was even supported in old versions: http://ftp.nchu.edu.tw/MySQL/doc/refman/4.1/en/create-table.html

Not sure why it wasn't used right away. A comment in the code refers to #153 but looks like that ID wasn't 100% correctly migrated from the old trac. In any way, using if not exists should be fine...

This can avoid some error logs depending on the used database adapter etc. In theory we can then remove catching the error a few lines below but should be fine to keep it as well
@tsteur tsteur added the Needs Review PRs that need a code review label Sep 11, 2019
@tsteur tsteur added this to the 3.12.0 milestone Sep 11, 2019
@diosmosis diosmosis merged commit 7b140a9 into 3.x-dev Sep 11, 2019
@diosmosis diosmosis deleted the createtableifnotexists branch September 11, 2019 07:43
@mattab mattab added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants