简体   繁体   中英

Disable Primary Key in Sequelize JS

Is there a way to disable the automatic generated primary key inside Sequelize JS?

We create our tables inside PostgreSQL using Sequelize's sync method. But we've a problem with our junction tables.... We don't want a primary key in our junction table, but Sequelize generates one automatically if we don't specify one our selves. I can specify a primary key on all columns, but that's not the best way to do it....

Anyone who knows how to disable primary keys inside Sequelize JS?

Model.removeAttribute("id");

更多文档removeAttribute

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM