i have a problem to understand how to create UUID in adonisjs, my database using MySQL. When i'm start server and post data, this id_customer output still in auto-increment model. Anyone can help me how to solving this problem?
This is schema code in my migration file:
async up () {
await this.db.raw('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";')
}
up () {
this.create('customers', (table) => {
table.increments()
table.uuid('id_customer').primary().defaultTo(this.db.raw('uuid_generate_v4()'))
table.timestamps()
})
}