hi, i have a about 5 tables that has a function t...
# help
a
hi, i have a about 5 tables that has a function that is triggered by an input in table name 'event' in the other tables have a foreign key named 'event_id' how do i delete all rows from all tables that has the event_id of 'number' instead of doing it 1 by 1
n
Hello @Ape R Us! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
Sort of unclear, but if you mean you are deleting an event row from the event table and you want to delete all rows in tables with foreign keys on event table that have that rows id, then you use cascade delete on each of those foreign keys. event_id integer REFERENCES event ON DELETE CASCADE
n
Ape R Us (2022-05-05)
a
example the main table is named event and cols of event_id a foreign table name event_general has a foregin key of event_id i want to delete all rows with event_id of a number in all tables