Estoy tratando de indexar las columnas created_at y updated_at con knex js, pero cuando asigno index(), me muestra este error:
La propiedad 'índice' no existe en el tipo 'vacío'
await knex.schema.createTable('ontario_user_reports', (table) => { table.string('user_id').notNullable().index(); table.timestamps(false, true).index(); // here table.string('type').notNullable().index(); });¿Me puede proponer una forma correcta de indexar created_at?
Debería poder agregar su índice de esta manera:
await knex.schema.createTable('ontario_user_reports', (table) => { table.string('user_id').notNullable().index(); table.timestamps(false, true); table.string('type').notNullable().index(); // Add this line: table.index('created_at'); });Opcionalmente, establezca un nombre y opciones adicionales usando los parámetros como se describe aquí: https://knexjs.org/#Schema-index