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

Set config_name column in config table as a unique index #3268

Merged
merged 1 commit into from
Mar 22, 2016

Conversation

murrant
Copy link
Member

@murrant murrant commented Mar 19, 2016

Work around possible duplicates by keeping the first record.

Work around possible duplicates by keeping the first record.
@laf laf added the Schema label Mar 20, 2016
@@ -0,0 +1,5 @@
CREATE TABLE tmp_table LIKE config;
ALTER IGNORE TABLE tmp_table ADD UNIQUE INDEX uniqueindex_configname (config_name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of interest why the choice in name for this index?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the name laravel picks when it creates indexes. It isn't needed here, I can drop it if you like. I put the name in because I was testing with the laravel schema and rollback.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's fine, especially if it's from the Laravel stuff as I had to fix some issues with our schema build to port it over to Laravel so much prefer if it's right from day one.

laf added a commit that referenced this pull request Mar 22, 2016
Set config_name column in config table as a unique index
@laf laf merged commit 75e1712 into librenms:master Mar 22, 2016
@murrant murrant deleted the config-name-unique-index branch July 1, 2016 20:48
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants