Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Device.id becomes the primary key. The existing unique index on "id" is
-- reused, so Postgres renames it to "Device_pkey" without rebuilding it. The
-- column is already NOT NULL, so no table scan is needed.
ALTER TABLE "Device" ADD CONSTRAINT "Device_pkey" PRIMARY KEY USING INDEX "Device_id_key";
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ model User {
}

model Device {
id String @unique
id String @id
lastSeen DateTime? @db.Timestamp(6)
name String?
user User @relation(fields: [userId], references: [id])
Expand Down
Loading