Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade prisma to version 6 #1604

Merged
merged 3 commits into from
Feb 3, 2025
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,29 @@
-- AlterTable
ALTER TABLE "_AssetReminderToTeamMember" ADD CONSTRAINT "_AssetReminderToTeamMember_AB_pkey" PRIMARY KEY ("A", "B");

-- DropIndex
DROP INDEX "_AssetReminderToTeamMember_AB_unique";

-- AlterTable
ALTER TABLE "_AssetToBooking" ADD CONSTRAINT "_AssetToBooking_AB_pkey" PRIMARY KEY ("A", "B");

-- DropIndex
DROP INDEX "_AssetToBooking_AB_unique";

-- AlterTable
ALTER TABLE "_AssetToTag" ADD CONSTRAINT "_AssetToTag_AB_pkey" PRIMARY KEY ("A", "B");

-- DropIndex
DROP INDEX "_AssetToTag_AB_unique";

-- AlterTable
ALTER TABLE "_CategoryToCustomField" ADD CONSTRAINT "_CategoryToCustomField_AB_pkey" PRIMARY KEY ("A", "B");

-- DropIndex
DROP INDEX "_CategoryToCustomField_AB_unique";

-- AlterTable
ALTER TABLE "_RoleToUser" ADD CONSTRAINT "_RoleToUser_AB_pkey" PRIMARY KEY ("A", "B");

-- DropIndex
DROP INDEX "_RoleToUser_AB_unique";
2 changes: 1 addition & 1 deletion app/database/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
# It should be added in your version-control system (e.g., Git)
provider = "postgresql"
30 changes: 14 additions & 16 deletions app/database/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasource db {

generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch"]
previewFeatures = ["fullTextSearchPostgres"]
}

model Image {
Expand Down Expand Up @@ -766,27 +766,25 @@ model KitCustody {
}

model AssetReminder {
id String @id @default(cuid())
name String
message String
alertDateTime DateTime
id String @id @default(cuid())
name String
message String
alertDateTime DateTime
activeSchedulerReference String?
organization Organization @relation(fields: [organizationId], references: [id])
organizationId String
asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
assetId String
teamMembers TeamMember[]
createdBy User @relation(fields: [createdById], references: [id])
createdById String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
organization Organization @relation(fields: [organizationId], references: [id])
organizationId String
asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
assetId String
teamMembers TeamMember[]
createdBy User @relation(fields: [createdById], references: [id])
createdById String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

// Optimized indexes
@@index([assetId, alertDateTime])
@@index([name(ops: raw("gin_trgm_ops")), message(ops: raw("gin_trgm_ops"))], type: Gin)
@@index([organizationId, alertDateTime, assetId])

// For scheduler related queries
@@index([alertDateTime, activeSchedulerReference])

}
79 changes: 43 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@fullcalendar/timegrid": "^6.1.15",
"@markdoc/markdoc": "^0.4.0",
"@paralleldrive/cuid2": "^2.2.2",
"@prisma/client": "^5.9.1",
"@prisma/client": "^6.2.1",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-dropdown-menu": "2.0.6",
Expand Down Expand Up @@ -161,7 +161,7 @@
"postcss": "^8.4.38",
"prettier": "3.0.3",
"prettier-plugin-tailwindcss": "^0.5.11",
"prisma": "^5.9.1",
"prisma": "^6.2.1",
"remix-flat-routes": "^0.6.4",
"start-server-and-test": "^2.0.3",
"tailwind-scrollbar": "^3.1.0",
Expand Down