Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save btipling/7f47ed1b674fd73cf3838639f6232d16 to your computer and use it in GitHub Desktop.
Save btipling/7f47ed1b674fd73cf3838639f6232d16 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