sequelize / sequelize-auto

Automatically generate bare sequelize models from your database.
2.9k stars 527 forks source link

Fix #638 and #639: treat single column unique indexes as primary key #640

Open hhowe29 opened 1 year ago

hhowe29 commented 1 year ago
  1. Treat single column unique indexes as a primary key if no other primary key was found.
  2. Make assertion errors in build.test fail the test if they occur.

Fixes #638 and implement #639.

ephys commented 1 year ago

I don't think we should do #639. I understand that you have legacy tables but unique columns are not primary keys and we should not mark them as such in their corresponding models