AdonisJS
Migrations
Use the raw
method on the Schema Builder
.
First, create a migration:
node ace make:migration electrify_items
Then use this.schema.raw
in the up
function:
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class extends BaseSchema {
public async up () {
this.schema.raw("ALTER TABLE items ENABLE ELECTRIC")
}
}