Last active
April 13, 2019 11:31
-
-
Save mickhansen/966a67648c45dd5c25ee to your computer and use it in GitHub Desktop.
Sequelize JSONB indexing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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