-
Notifications
You must be signed in to change notification settings - Fork 4
[PB-6412] feat: added photos backups as folders #1069
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
Changes from 3 commits
6fd0d75
aa2b2ca
a0ee7ce
b2a2460
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| 'use strict'; | ||
|
|
||
| module.exports = { | ||
| up: async (queryInterface, Sequelize) => { | ||
| await queryInterface.addColumn('users', 'photos_bucket', { | ||
| type: Sequelize.STRING, | ||
| allowNull: true, | ||
| }); | ||
| }, | ||
|
|
||
| down: async (queryInterface) => { | ||
| await queryInterface.removeColumn('users', 'photos_bucket'); | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| 'use strict'; | ||
|
|
||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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' |
||
| ); | ||
| }, | ||
|
|
||
| async down(queryInterface) { | ||
| await queryInterface.sequelize.query( | ||
| `DROP INDEX CONCURRENTLY IF EXISTS bucket_index`, | ||
| ); | ||
| }, | ||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.