Skip to content

Commit

Permalink
fix: convert user image to db.Text
Browse files Browse the repository at this point in the history
  • Loading branch information
rschlaefli committed Dec 21, 2022
1 parent 28de78e commit 0785ad6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions prisma/migrations/20221221120417_image_text/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Warnings:
- You are about to alter the column `image` on the `User` table. The data in that column could be lost. The data in that column will be cast from `NVarChar(1000)` to `Text`.
*/
BEGIN TRY

BEGIN TRAN;

-- AlterTable
ALTER TABLE [dbo].[User] ALTER COLUMN [image] TEXT NULL;

COMMIT TRAN;

END TRY
BEGIN CATCH

IF @@TRANCOUNT > 0
BEGIN
ROLLBACK TRAN;
END;
THROW

END CATCH
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ model User {
name String
email String @unique
emailVerified DateTime?
image String?
image String? @db.Text
role String @default("UNSET")
Expand Down

0 comments on commit 0785ad6

Please sign in to comment.