Jaseem Abbas
Jaseem Abbas

Reputation: 5230

Sails.js : Is Waterline ORM safe without foreign key constraints?

I am developing a sails.js app with MySQL. I am using the out of the box waterline ORM which comes with sails.js. According to this post, waterline does not create foreign key constraints in the manner you describe. It only creates the associated field. Is it safe to proceed with waterline and go ahead and create tables?

Upvotes: 3

Views: 684

Answers (1)

vanadium23
vanadium23

Reputation: 3586

Yes, it is safe. Foreign keys prevent to insert values with id you don't have in related table, but on the other hand when you delete id, they don't delete rows from related tables, so there is no such event like cascade deletion and locking tables(or rows).

Upvotes: 2

Related Questions