mirror of
https://github.com/immich-app/immich.git
synced 2025-01-21 00:52:43 -05:00
feat: track when assets are added to an album (#13725)
This commit is contained in:
parent
5d9b4b4532
commit
bc06863d28
2 changed files with 14 additions and 1 deletions
|
@ -52,7 +52,7 @@ export class AlbumEntity {
|
||||||
albumUsers!: AlbumUserEntity[];
|
albumUsers!: AlbumUserEntity[];
|
||||||
|
|
||||||
@ManyToMany(() => AssetEntity, (asset) => asset.albums)
|
@ManyToMany(() => AssetEntity, (asset) => asset.albums)
|
||||||
@JoinTable()
|
@JoinTable({ synchronize: false })
|
||||||
assets!: AssetEntity[];
|
assets!: AssetEntity[];
|
||||||
|
|
||||||
@OneToMany(() => SharedLinkEntity, (link) => link.album)
|
@OneToMany(() => SharedLinkEntity, (link) => link.album)
|
||||||
|
|
|
@ -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"`);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue