Skip to content

Commit

Permalink
feat: track when assets are added to an album (#13725)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasm91 authored Oct 24, 2024
1 parent 5d9b4b4 commit bc06863
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/entities/album.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions server/src/migrations/1729793521993-AddAlbumAssetCreatedAt.ts
Original file line number Diff line number Diff line change
@@ -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"`);
}
}

0 comments on commit bc06863

Please sign in to comment.