Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Cómo indexar el tipo de marca de tiempo con knexjs

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?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!