MCPcopy
hub / github.com/sequelize/sequelize / _conformIndex

Method _conformIndex

src/model.js:788–804  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

786 }
787
788 static _conformIndex(index) {
789 if (!index.fields) {
790 throw new Error('Missing "fields" property for index definition');
791 }
792
793 index = _.defaults(index, {
794 type: '',
795 parser: null
796 });
797
798 if (index.type && index.type.toLowerCase() === 'unique') {
799 index.unique = true;
800 delete index.type;
801 }
802
803 return index;
804 }
805
806
807 static _uniqIncludes(options) {

Callers 3

initMethod · 0.95
refreshAttributesMethod · 0.95
addIndexQueryMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected