mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 02:51:13 -05:00
Fix: Correct foreign key constraint for reviews
This commit is contained in:
@@ -1101,6 +1101,13 @@ export type Database = {
|
||||
referencedRelation: "rides"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "reviews_user_id_fkey"
|
||||
columns: ["user_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "profiles"
|
||||
referencedColumns: ["user_id"]
|
||||
},
|
||||
]
|
||||
}
|
||||
ride_coaster_statistics: {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
-- Drop existing foreign key that points to auth.users
|
||||
ALTER TABLE public.reviews
|
||||
DROP CONSTRAINT IF EXISTS reviews_user_id_fkey;
|
||||
|
||||
-- Add new foreign key constraint pointing to profiles.user_id
|
||||
ALTER TABLE public.reviews
|
||||
ADD CONSTRAINT reviews_user_id_fkey
|
||||
FOREIGN KEY (user_id)
|
||||
REFERENCES public.profiles(user_id)
|
||||
ON DELETE CASCADE;
|
||||
Reference in New Issue
Block a user