Skip to content
Open
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,8 @@
-- CreateIndex
CREATE INDEX `Instance_clientName_idx` ON `Instance`(`clientName`);

-- CreateIndex
CREATE INDEX `Instance_token_idx` ON `Instance`(`token`);

-- CreateIndex
CREATE INDEX `Instance_number_idx` ON `Instance`(`number`);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- CreateIndex
CREATE INDEX IF NOT EXISTS "Instance_clientName_idx" ON "Instance"("clientName");

-- CreateIndex
CREATE INDEX IF NOT EXISTS "Instance_token_idx" ON "Instance"("token");

-- CreateIndex
CREATE INDEX IF NOT EXISTS "Instance_number_idx" ON "Instance"("number");
Comment on lines +2 to +8
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Using IF NOT EXISTS in migrations can hide schema drift and make future index changes harder.

This can let an index with the wrong definition (columns, collation, options) slip through, since the migration appears to succeed even though the index shape doesn’t match what you expect. Given that Prisma migrations are linear and controlled, it’s safer to omit IF NOT EXISTS so any mismatch fails loudly and surfaces schema drift early.