Skip to content

Instantly share code, notes, and snippets.

@mickhansen
Last active April 13, 2019 11:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mickhansen/966a67648c45dd5c25ee to your computer and use it in GitHub Desktop.
Save mickhansen/966a67648c45dd5c25ee to your computer and use it in GitHub Desktop.
Sequelize JSONB indexing
indexes: [
{
using: 'GIN',
fields: ['field']
}
]
// CREATE INDEX field ON $modelTable USING gin (field);
indexes: [
{
using: 'GIN',
operator: 'jsonb_path_ops',
fields: ['field']
}
]
// CREATE INDEX field ON $modelTable USING gin (field jsonb_path_ops);
{
field: {
type: Sequelize.JSONB,
index: true
}
}
Should be converted to:
indexes: [
{
using: 'GIN',
fields: ['field']
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment