B
B
Bogdan2017-07-26 14:39:23
Ruby on Rails
Bogdan, 2017-07-26 14:39:23

Rals + PostrgreSQL cascading delete?

Hello. My deletion is done directly in the database through ActiveRecord::Base.connection.execute.
Therefore it is necessary to make values ​​of foreign keys (foreing_key) ON DELETE CASCADE ?
How to implement this correctly and how to specify this value when creating new tables in migration? Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question