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

refactor(SQL/legacy): Add primary key to vehicles table #1436

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Kenshiin13
Copy link
Contributor

@Kenshiin13 Kenshiin13 commented Nov 2, 2024

Description:

This PR sets the model column as the primary key for the existing vehicles table.


Motivation:

  • Data Integrity: The primary key enforces uniqueness, ensuring each vehicle can be distinctly identified.
  • Ease of Editing: With a primary key in place, we can easily manage and edit rows in tools like phpMyAdmin.

@Rav3n95
Copy link
Collaborator

Rav3n95 commented Nov 2, 2024

If something i would add the primary key to the model instead of a new id columb. The reason behind it, its because you can still make duplicates.

@Kenshiin13
Copy link
Contributor Author

If something i would add the primary key to the model instead of a new id columb. The reason behind it, its because you can still make duplicates.

Which may be intended. I could imagine having the same vehicle model in 2 different categories with a different price.

@Bossman02
Copy link

That makes no sense, why do you want to have the same vehicle in 2 categories with different prices?, nobody is going to buy the one in the expensive category.

I agree with raven, it is the change I always make to this table

@Kenshiin13
Copy link
Contributor Author

That makes no sense, why do you want to have the same vehicle in 2 categories with different prices?, nobody is going to buy the one in the expensive category.

I agree with raven, it is the change I always make to this table

Nevermind, I just checked the vehicleshop script again and I have to agree with both of you. I thought you were able to limit access to certain categories to specific groups/jobs out of the box, but that is not the case. So there really is no reason to allow for duplicate models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

3 participants