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

Add primary keys to tables that don't have them #9363

Closed
wants to merge 4 commits into from
Closed

Add primary keys to tables that don't have them #9363

wants to merge 4 commits into from

Conversation

Jelle-S
Copy link

@Jelle-S Jelle-S commented Mar 30, 2021

Description

Adds primary keys to tables where they are missing.

In short: Some database systems (like XtraDB cluster) require explicit primary keys for all tables, so this PR adds them to those that are missing them.
See laravel/framework#15770 for a thorough explanation and more context.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested on our environment where the migrations table was missing the id column (shows you we've been using this since at least 2016 😅 ) and with the default database you get when installing snipe it

Checklist:

Some mysql clusters (like Percona-XtraDB-Cluster) prohibit the use of DML
commands on a table. It's also just a good practice to add it.
Some mysql clusters (like Percona-XtraDB-Cluster) prohibit the use of DML
commands on a table. It's also just a good practice to add it.

See laravel/framework#15770
Some mysql clusters (like Percona-XtraDB-Cluster) prohibit the use of DML
commands on a table. It's also just a good practice to add it.
@snipe
Copy link
Owner

snipe commented Apr 6, 2021

We actually specifically do not use primary keys other than incrementing ids in Snipe-IT. We used to have them, but they caused HUGE amounts of problems as requirements and systems changed (stuff that used to not be nullable and had no value then became nullable, etc). If it will still work for your use-case without the custom_field_custom_fieldset, we can probably take this though.

@snipe snipe closed this Apr 14, 2021
snipe added a commit that referenced this pull request Apr 14, 2021
This reproduces #9363 without the PK in custom fields

Signed-off-by: snipe <snipe@snipe.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants