[PR #1582] [MERGED] infra(server): fix Album TypeORM relations and change ids to uuids #9150

Closed
opened 2026-02-05 13:59:25 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/1582
Author: @zackpollard
Created: 2/8/2023
Status: Merged
Merged: 2/18/2023
Merged by: @alextran1502

Base: mainHead: infra/fix-relations-and-ids-to-uuids


📝 Commits (3)

  • 4a6bc6a infra: make api-key primary key column a UUID
  • 6ef5078 infra: move ManyToMany relations in album entity, make ownerId ManyToOne
  • 5357afa Merge branch 'main' of github.com:immich-app/immich into infra/fix-relations-and-ids-to-uuids

📊 Changes

24 files changed (+369 additions, -462 deletions)

View changed files

📝 server/apps/immich/src/api-v1/album/album-repository.ts (+87 -201)
📝 server/apps/immich/src/api-v1/album/album.module.ts (+3 -8)
📝 server/apps/immich/src/api-v1/album/album.service.spec.ts (+16 -45)
📝 server/apps/immich/src/api-v1/album/album.service.ts (+18 -18)
📝 server/apps/immich/src/api-v1/asset/asset.module.ts (+2 -2)
📝 server/apps/immich/src/controllers/api-key.controller.ts (+4 -4)
📝 server/immich-openapi-specs.json (+4 -4)
📝 server/libs/domain/src/album/response-dto/album-response.dto.ts (+7 -11)
📝 server/libs/domain/src/api-key/api-key.repository.ts (+3 -3)
📝 server/libs/domain/src/api-key/api-key.service.spec.ts (+14 -12)
📝 server/libs/domain/src/api-key/api-key.service.ts (+3 -3)
📝 server/libs/domain/src/api-key/response-dto/api-key-response.dto.ts (+1 -3)
📝 server/libs/domain/src/share/response-dto/shared-link-response.dto.ts (+2 -2)
📝 server/libs/domain/test/fixtures.ts (+78 -59)
📝 server/libs/infra/src/db/entities/album.entity.ts (+12 -9)
📝 server/libs/infra/src/db/entities/api-key.entity.ts (+5 -5)
server/libs/infra/src/db/entities/asset-album.entity.ts (+0 -31)
📝 server/libs/infra/src/db/entities/index.ts (+0 -2)
server/libs/infra/src/db/entities/user-album.entity.ts (+0 -27)
server/libs/infra/src/db/migrations/1675808874445-APIKeyUUIDPrimaryKey.ts (+20 -0)

...and 4 more files

📄 Description

Updates Album TypeORM entity to use correct ManyToMany relations for sharedUsers and assets.
Updates API Key TypeORM entity to use UUIDs for the ID column.

Part 1 of fixing TypeORM entities to follow the same standards


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/1582 **Author:** [@zackpollard](https://github.com/zackpollard) **Created:** 2/8/2023 **Status:** ✅ Merged **Merged:** 2/18/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `infra/fix-relations-and-ids-to-uuids` --- ### 📝 Commits (3) - [`4a6bc6a`](https://github.com/immich-app/immich/commit/4a6bc6a9727eacc59cbebf36718a521b91a3dc61) infra: make api-key primary key column a UUID - [`6ef5078`](https://github.com/immich-app/immich/commit/6ef50780fd3e07fcef90ec51fea68acf95ef5939) infra: move ManyToMany relations in album entity, make ownerId ManyToOne - [`5357afa`](https://github.com/immich-app/immich/commit/5357afaeb11a6e44ccdcc92baf4e50f728851259) Merge branch 'main' of github.com:immich-app/immich into infra/fix-relations-and-ids-to-uuids ### 📊 Changes **24 files changed** (+369 additions, -462 deletions) <details> <summary>View changed files</summary> 📝 `server/apps/immich/src/api-v1/album/album-repository.ts` (+87 -201) 📝 `server/apps/immich/src/api-v1/album/album.module.ts` (+3 -8) 📝 `server/apps/immich/src/api-v1/album/album.service.spec.ts` (+16 -45) 📝 `server/apps/immich/src/api-v1/album/album.service.ts` (+18 -18) 📝 `server/apps/immich/src/api-v1/asset/asset.module.ts` (+2 -2) 📝 `server/apps/immich/src/controllers/api-key.controller.ts` (+4 -4) 📝 `server/immich-openapi-specs.json` (+4 -4) 📝 `server/libs/domain/src/album/response-dto/album-response.dto.ts` (+7 -11) 📝 `server/libs/domain/src/api-key/api-key.repository.ts` (+3 -3) 📝 `server/libs/domain/src/api-key/api-key.service.spec.ts` (+14 -12) 📝 `server/libs/domain/src/api-key/api-key.service.ts` (+3 -3) 📝 `server/libs/domain/src/api-key/response-dto/api-key-response.dto.ts` (+1 -3) 📝 `server/libs/domain/src/share/response-dto/shared-link-response.dto.ts` (+2 -2) 📝 `server/libs/domain/test/fixtures.ts` (+78 -59) 📝 `server/libs/infra/src/db/entities/album.entity.ts` (+12 -9) 📝 `server/libs/infra/src/db/entities/api-key.entity.ts` (+5 -5) ➖ `server/libs/infra/src/db/entities/asset-album.entity.ts` (+0 -31) 📝 `server/libs/infra/src/db/entities/index.ts` (+0 -2) ➖ `server/libs/infra/src/db/entities/user-album.entity.ts` (+0 -27) ➕ `server/libs/infra/src/db/migrations/1675808874445-APIKeyUUIDPrimaryKey.ts` (+20 -0) _...and 4 more files_ </details> ### 📄 Description Updates Album TypeORM entity to use correct ManyToMany relations for sharedUsers and assets. Updates API Key TypeORM entity to use UUIDs for the ID column. Part 1 of fixing TypeORM entities to follow the same standards --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 13:59:25 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#9150