We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/demopark/sequelize-docs-Zh-CN/blob/master/associations.md#%E5%A4%96%E9%94%AE
当您在模型中创建关联时,会自动创建带约束的外键引用。 下面是设置:
const Task = sequelize.define('task', { title: Sequelize.STRING }); const User = sequelize.define('user', { username: Sequelize.STRING }); User.hasMany(Task); // 将会添加 userId 到 Task 模型 Task.belongsTo(User); // 也将会添加 userId 到 Task 模型
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://github.com/demopark/sequelize-docs-Zh-CN/blob/master/associations.md#%E5%A4%96%E9%94%AE
外键
当您在模型中创建关联时,会自动创建带约束的外键引用。 下面是设置:
The text was updated successfully, but these errors were encountered: