-
Notifications
You must be signed in to change notification settings - Fork 190
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
Binary Flags instead of booleans make queries complex #191
Comments
It also makes query very slow. MySql can't use index in combination with binary operations. |
I introduced that as a legacy from Akregator and I totally agree that we should work on removing it. |
Anyone willing to work on this? |
Btw, 0x16 is quite hilarious actually |
11:38 <@BernhardPosselt> gmc: regarding the binary flag PR |
http://nextcloudappstore.readthedocs.io/en/latest/developer.html#info-xml under 'repair-steps' mentions how to migrate databases, but also mentions 'will not be used, only validated' for anything under repair-steps.. However, a quick grep through NC codebase suggests repair-steps are indeed executed. |
The will not be used comment basically means that the app store ignores it not nextcloud |
Fixed by @danopz |
This is a technical debt issue from the very beginning of the News app that I was basically avoiding because migration is work intensive.
Instead of having boolean fields for stuff like unread and starred the news app uses binary flags:
In binary this would look like:
every 0 means false, every 1 means true.
for instance means that the item is unread and starred.
Note: only unread and starred are actually used!
As you see this is basically doing binary math with php binary operators and not only leads to brainfuck but also to issues like having to string concatenate Sql statements because you can't do binary math with parameters:
This should be refactored into boolean columns instead (including a migration that migrates the previous status)
The text was updated successfully, but these errors were encountered: