forge->addField([ 'id' => ['type' => 'BIGINT', 'unsigned' => true, 'auto_increment' => true], 'name' => ['type' => 'VARCHAR', 'constraint' => 32], 'tool_slug' => ['type' => 'VARCHAR', 'constraint' => 120, 'null' => true], 'format' => ['type' => 'VARCHAR', 'constraint' => 16, 'null' => true], 'value' => ['type' => 'BIGINT', 'unsigned' => true, 'default' => 0], 'session_id' => ['type' => 'VARCHAR', 'constraint' => 64, 'null' => true], 'country' => ['type' => 'CHAR', 'constraint' => 2, 'null' => true], 'meta' => ['type' => 'JSON', 'null' => true], 'created_at' => ['type' => 'DATETIME', 'null' => true], ]); $this->forge->addPrimaryKey('id'); $this->forge->addKey('name'); $this->forge->addKey('created_at'); $this->forge->addKey('tool_slug'); $this->forge->createTable('analytics_events', true); } public function down(): void { $this->forge->dropTable('analytics_events', true); } }