Skip to content

High performance self-hosted photo and video management solution.

feat: track when assets are added to an album (#13725)

Jason Rasmussenbc06863d287c
diff --git a/server/src/entities/album.entity.ts b/server/src/entities/album.entity.ts
index e5d2c98814..5aec5a0f47 100644
--- a/server/src/entities/album.entity.ts
+++ b/server/src/entities/album.entity.ts
@@ -52,7 +52,7 @@ export class AlbumEntity {
albumUsers!: AlbumUserEntity[];
@ManyToMany(() => AssetEntity, (asset) => asset.albums)
- @JoinTable()
+ @JoinTable({ synchronize: false })
assets!: AssetEntity[];
@OneToMany(() => SharedLinkEntity, (link) => link.album)
diff --git a/server/src/migrations/1729793521993-AddAlbumAssetCreatedAt.ts b/server/src/migrations/1729793521993-AddAlbumAssetCreatedAt.ts
new file mode 100644
index 0000000000..280b34890d
--- /dev/null
+++ b/server/src/migrations/1729793521993-AddAlbumAssetCreatedAt.ts
@@ -0,0 +1,13 @@
+import { MigrationInterface, QueryRunner } from 'typeorm';
+
+export class AddAlbumAssetCreatedAt1729793521993 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `ALTER TABLE "albums_assets_assets" ADD COLUMN "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()`,
+ );
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "albums_assets_assets" DROP COLUMN "createdAt"`);
+ }
+}