UNPKG

@brighthustle/adonisjs-whatsapp

Version:

Connect your WhatsApp Cloud API with AdonisJS

25 lines (20 loc) 766 B
import BaseSchema from '@ioc:Adonis/Lucid/Schema' export default class extends BaseSchema { protected tableName = '{{ whatsappTableName }}' public async up() { this.schema.createTable(this.tableName, (table) => { table.increments('id').primary() table.string('phone_number_id').notNullable().unique() table.string('access_token').notNullable() table.string('api_provider', 40).notNullable() table.string('whatsapp_business_id').nullable().unique() table.string('verify_token').nullable() table.string('graph_version').nullable().defaultTo(null) table.string('graph_url').nullable().defaultTo(null) table.timestamps() }) } public async down() { this.schema.dropTable(this.tableName) } }