table('audit_log'); $table ->addColumn('user_id', 'string', ['limit' => 36, 'null' => true]) ->addColumn('action', 'string', ['limit' => 100, 'null' => false]) ->addColumn('entity_type', 'string', ['limit' => 50, 'null' => true]) ->addColumn('entity_id', 'string', ['limit' => 36, 'null' => true]) ->addColumn('details_json', 'text', ['null' => true]) ->addColumn('created_at', 'datetime', ['null' => false, 'default' => 'CURRENT_TIMESTAMP']) ->addIndex(['action']) ->addIndex(['entity_type', 'entity_id']) ->addIndex(['created_at']) ->create(); } }