Skip to content

Commit

Permalink
feat: ✨ add migration to turn uuid required
Browse files Browse the repository at this point in the history
  • Loading branch information
willMoraes committed Jun 3, 2024
1 parent 37cc727 commit c25e955
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Warnings:
- A unique constraint covering the columns `[uuid]` on the table `Shelter` will be added. If there are existing duplicate values, this will fail.
- Made the column `uuid` on table `Shelter` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "Shelter" ALTER COLUMN "uuid" SET NOT NULL;

-- CreateIndex
CREATE UNIQUE INDEX "Shelter_uuid_key" ON "Shelter"("uuid");
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ datasource db {

model Shelter {
id Int @id @default(autoincrement())
uuid String? @default(cuid())
uuid String @unique @default(cuid())
name String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Expand Down

0 comments on commit c25e955

Please sign in to comment.