diff --git a/data.sql b/data.sql index 09f9311..9c9eb07 100644 --- a/data.sql +++ b/data.sql @@ -90,14 +90,14 @@ CREATE TABLE status notification_services_status DEFAULT 'pending', notification_id UUID REFERENCES notifications (id) ON DELETE CASCADE ); - + CREATE TABLE IF NOT EXISTS notifications_achievements ( id UUID PRIMARY KEY DEFAULT uuid_generate_v4 (), - achievement_user_id UUID REFERENCES notifications (id) ON DELETE CASCADE + achievement_user_id UUID REFERENCES user_achievements (id) ON DELETE CASCADE, + notification_id UUID REFERENCES notifications (id) ON DELETE CASCADE ); - CREATE OR REPLACE FUNCTION update_updated_at_column() RETURNS TRIGGER AS $$ BEGIN @@ -169,4 +169,4 @@ VALUES 'Community Cohesion: Engage in 5 Vibrant Service Interactions', 'get 5 services accepted. ', 100 - ); \ No newline at end of file + );