Skip to content
New issue

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

Update model-basics.md #426

Closed
wants to merge 2 commits into from
Closed

Update model-basics.md #426

wants to merge 2 commits into from

Conversation

damms005
Copy link
Contributor

Provide additional comment on usage of composite index in model definition

Provide additional comment on usage of composite index in model definition
Add notice of alternative
@@ -425,7 +425,9 @@ Foo.init({

// Creating two objects with the same value will throw an error. The unique property can be either a
// boolean, or a string. If you provide the same string for multiple columns, they will form a
// composite unique key.
// composite unique key. Note that this does not work with neither Sequelize.define() nor
// QueryInterface.createTable(). Details here: https://github.com/sequelize/sequelize/issues/14039
Copy link
Member

@ephys ephys Mar 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sequelize.define() is a wrapper around Model.init() so this option does work with define

Separately, I don't think it's the role of the model documentation to explain how createTable works. That's a concern for a separate documentation dedicated to queryInterface

@damms005 damms005 closed this Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants