sequelize / sequelize-auto

Automatically generate bare sequelize models from your database.
2.91k stars 529 forks source link

onDelete CASCADE #595

Open JSchatral opened 2 years ago

JSchatral commented 2 years ago

I have set "ON DELETE" to CASCADE in the OrderItem table in the Northwind database (MariaDB). If an Order should be deleted, all OrderItems should also be deleted. Rerun Node export.js. Sample-es5 - When I look in the object for "onDelete" it still says "No ACTION". What am I doing wrong? Greetings from Germany.

J.Schatral

MathRobin commented 11 months ago

Hello ! Bit late, sequelize-auto natively doesn't care about constraints like update and delete rules, there is no code about it.

I have made a public fork for my company needs (mysql, changes should be similar that some needed for MariaDB), you can watch at changes here : https://github.com/airporting/sequelize-auto