import { BaseSchema } from '@adonisjs/lucid/schema';
export default class extends BaseSchema {
    tableName = 'scammer_logs';
    async up() {
        this.schema.createTable(this.tableName, (table) => {
            table.increments('id');
            table.string('phone', 30).notNullable();
            table.string('name', 100).nullable();
            table.string('group_jid', 100).nullable();
            table.string('group_name', 100).nullable();
            table.string('device_id', 50).nullable();
            table.enum('action_taken', ['log', 'warn', 'kick', 'block', 'threshold_blacklisted']).notNullable().defaultTo('log');
            table.enum('triggered_by', ['blacklist', 'keyword', 'threshold']).notNullable().defaultTo('blacklist');
            table.string('matched_keyword', 200).nullable();
            table.text('message_preview').nullable();
            table.timestamp('created_at');
            table.timestamp('updated_at');
        });
    }
    async down() {
        this.schema.dropTable(this.tableName);
    }
}
