Skip to content

Commit

Permalink
hotfix: repair album table's photo_count column
Browse files Browse the repository at this point in the history
  • Loading branch information
gmkim20713 committed Sep 26, 2024
1 parent 5a4be5b commit 69fa040
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class AlbumEntity implements Persistable<String> {
@Column("type")
private AlbumType type;

@Column("photoCount")
@Column("photo_count")
private Integer photoCount;

@Column("owner_member_id")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ALTER TABLE album
RENAME COLUMN photoCount TO photo_count;

UPDATE album a
SET photo_count = (
SELECT COUNT(p.id)
FROM photo p
WHERE p.album_id = a.id
);

0 comments on commit 69fa040

Please sign in to comment.