Skip to content

Commit

Permalink
feat: 🎈 (api/infra/prisma) hashedFingerprintId の長さを固定
Browse files Browse the repository at this point in the history
  • Loading branch information
dino3616 committed Feb 3, 2024
1 parent 661335b commit 4960bf3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
Warnings:
- You are about to alter the column `hashed_fingerprint_id` on the `users` table. The data in that column could be lost. The data in that column will be cast from `Text` to `Char(64)`.
*/
-- AlterTable
ALTER TABLE "users"
ALTER COLUMN "hashed_fingerprint_id"
SET DATA TYPE CHAR(64);
3 changes: 1 addition & 2 deletions apps/api/src/infra/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ enum LostAndFoundState {
model User {
id String @id @default(uuid()) @db.Uuid
authId String @unique @map("auth_id") @db.Uuid
// TODO: Change to varchar or uuid as soon as the format of the string is known.
hashedFingerprintId String? @unique @map("hashed_fingerprint_id")
hashedFingerprintId String? @unique @map("hashed_fingerprint_id") @db.Char(64)
name String @map("name") @db.VarChar(64)
email String @map("email") @db.VarChar(320)
lostAndFoundState LostAndFoundState @default(NONE) @map("lost_and_found_state")
Expand Down
3 changes: 3 additions & 0 deletions supabase/migrations/20240203055806_migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "public"."users"
ALTER COLUMN "hashed_fingerprint_id"
SET DATA TYPE CHARACTER(64) USING "hashed_fingerprint_id"::CHARACTER(64);

0 comments on commit 4960bf3

Please sign in to comment.