Repository navigation
feat(server): improve thumbnail relation and updating - #1897
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
|
Changed the query for To the migrations I've added a slightly modified version of the |
|
|
||
| public async up(queryRunner: QueryRunner): Promise<void> { | ||
| // Make sure all albums have a valid albumThumbnailAssetId UUID or NULL. | ||
| await queryRunner.query(` |
There was a problem hiding this comment.
This is the manual query for migration, not from the generated command, correct?
There was a problem hiding this comment.
This is the query that gets generated by AlbumRepository.updateThumbnails() with one added ::varchar cast at the end. The query below this one is also custom, because the generated command removes and then re-adds the column which would result in data loss.
|
@michelheusschen Hi Michel, can you help fix the unit tests? |
600434e to
dbedb38
Compare
Unit tests are fixed. Rebasing went a bit wrong but I've sorted it out |
Added
albumThumnailAssetIdforeign key toAssetEntity. It should actually be a composite foreign key to the linking table of assets and albums, but I've not done that due to quite some added complexity, because the linking table has to be defined explicitly.Reworking
AlbumService._checkValidThumbnailmeans we no longer need to pull all assets from the database inAlbumService.getAllAlbumsand then those queries can be optimized further, which has recently been causing some performance bottlenecks.Still WIP and haven't tested it beyond the basics