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

Bugfix to PR 4046: Repaired query #4049

Merged
merged 1 commit into from
Dec 10, 2017

Conversation

annando
Copy link
Collaborator

@annando annando commented Dec 10, 2017

This repairs the query in the function getByContactIdForUserId of PR #4046

@MrPetovan
Copy link
Collaborator

Ok, the reason why I changed the query is because I want to get rid of the uid column in the group_member table. It's a redundant piece of information present both in the group table and the contact table each row is referring to.

This is valid but it could even be simplified by getting rid of the $uid function parameter, which reduces the function to getByContactId.

@annando
Copy link
Collaborator Author

annando commented Dec 10, 2017

Edit: This function currently has two parameters that had been used before. The query could be simplified by omitting the uid, but I mostly changed this query, since it had generated an SQL error and additionally had returned the wrong parameter.

@MrPetovan
Copy link
Collaborator

I know why you changed it, I'm just saying it can be changed further.

@MrPetovan MrPetovan merged commit 8d57c7c into friendica:develop Dec 10, 2017
@annando annando deleted the bugfix-pr-4046 branch December 10, 2017 21:56
@annando
Copy link
Collaborator Author

annando commented Dec 10, 2017

Yeah there is much where we can simplify the database structure.

@annando
Copy link
Collaborator Author

annando commented Dec 10, 2017

BTW: Additionally we are having several unneeded "id" fields (as auto increment) in many tables.

@MrPetovan
Copy link
Collaborator

Indeed, I'm not done with my database assessment, but it definitely is on the list.

@annando
Copy link
Collaborator Author

annando commented Dec 10, 2017

This is complicated since we have to replace the primary fields which will sometimes make problems since we will have duplicated data - and Oracle's MySQL is a little bit hypersensitive concerning this. (MariaDB is more insensitive)

@MrPetovan
Copy link
Collaborator

Duly noted, we'll have to dedupe the tables first, then move the primary key, then remove the columns.

@annando
Copy link
Collaborator Author

annando commented Dec 10, 2017

We already are having a function that replaces duplicates - but it does work only well with older MySQL and MariaDB.

@MrPetovan MrPetovan added this to the 3.6 milestone Mar 9, 2018
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.

None yet

2 participants