Skip to content

Commit

Permalink
fix: migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
2paperstar committed Jun 7, 2024
1 parent 0d9b372 commit f586cdd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
*/
-- AlterTable
ALTER TABLE "lookbook" DROP COLUMN "imageUrl",
ADD COLUMN "image_uuid" TEXT NOT NULL;
-- ALTER TABLE "lookbook" DROP COLUMN "imageUrl",
-- ADD COLUMN "image_uuid" TEXT NOT NULL;

ALTER TABLE "lookbook" RENAME COLUMN "imageUrl" TO "image_uuid";

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
*/
-- AlterTable
ALTER TABLE "file" DROP COLUMN "url",
ADD COLUMN "image_uuid" TEXT NOT NULL;
-- ALTER TABLE "file" DROP COLUMN "url",
-- ADD COLUMN "image_uuid" TEXT NOT NULL;

ALTER TABLE "file" RENAME COLUMN "url" TO "image_uuid";
2 changes: 1 addition & 1 deletion src/post/post.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class PostService {
createPostDto,
userUuid,
createPostDto.imageUrls.map((url) =>
new URL(url).pathname.split('/').slice(1).join('/'),
new URL(url).pathname.split('/').slice(2).join('/'),
),
);

Expand Down

0 comments on commit f586cdd

Please sign in to comment.