Skip to content

Commit

Permalink
fix: delete cascade and swagger scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
HungLV46 committed Aug 19, 2024
1 parent 24b98c5 commit 829570d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- DropForeignKey
ALTER TABLE "user_attributes" DROP CONSTRAINT "user_attributes_user_id_fkey";

-- AddForeignKey
ALTER TABLE "user_attributes" ADD CONSTRAINT "user_attributes_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ model UserAttribute {
value String
user_id Int
user User @relation(fields: [user_id], references: [id])
user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
@@unique([name, value, user_id])
@@index([name, value])
Expand Down
1 change: 1 addition & 0 deletions src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ async function registerPlugins(server: Hapi.Server): Promise<void> {
title: 'Test API Documentation',
version: '1.0.0',
},
schemes: ['http', 'https'],
documentationPage: true,
documentationPath: '/docs', // This sets the URL path for the Swagger UI
},
Expand Down

0 comments on commit 829570d

Please sign in to comment.