[PB-6412] feat: added photos backups as folders#1069
Open
apsantiso wants to merge 4 commits into
Open
Conversation
7fd95f7 to
21fc5ae
Compare
21fc5ae to
6fd0d75
Compare
d3bf58d to
318ebb6
Compare
318ebb6 to
7de032c
Compare
7de032c to
a0ee7ce
Compare
apsantiso
commented
May 27, 2026
| module.exports = { | ||
| async up(queryInterface) { | ||
| await queryInterface.sequelize.query( | ||
| `CREATE INDEX CONCURRENTLY IF NOT EXISTS bucket_index ON folders (bucket) WHERE deleted = false AND removed = false`, |
Collaborator
Author
There was a problem hiding this comment.
The index was removed from prod, but we look by bucket when fetching any device as folder.
Member
There was a problem hiding this comment.
Does the device have parent folder ? If not, add the parent_id NULL condition to the index, so we avoid indexing the whole folders-existing part just for a minority of records that act as 'devices'
apsantiso
commented
May 27, 2026
sg-gs
reviewed
May 28, 2026
…ion to index predicate
18a3c75 to
b2a2460
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Added photos backups. The idea is to follow the same principles as deviceAsFolder.
I wanted to avoid creating a new field in the users table, but as we do not have other ways to save buckets (for the time being) and to introduce this without too much changes, it is more straightforward to just add the bucket to that table like we do with backups.
Changes