Closed becauseinterwebs closed 3 years ago
How is an index created when defining tables?
After digging through the source, I have tried:
var User = db.define('user', { id : { type: 'serial', key: true }, userId : { type: 'integer', required: true, mapsTo: 'user_id', index: true }, ip : { type: 'text', size: 15, required: true }, createdAt : { type: 'date', time: true, mapsTo : 'created_at' }, updatedAt : { type: 'date', time: true, mapsTo : 'updated_at' } }
I have also tried adding an indexes option. No matter what I try the index is not created and I do not see it anywhere in the documentation.
I am using node-orm2 v3.2.4
You will need to manually create the index in the database.
How is an index created when defining tables?
After digging through the source, I have tried:
I have also tried adding an indexes option. No matter what I try the index is not created and I do not see it anywhere in the documentation.