forge->addColumn('operations', [ 'receipt_id' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true, 'after' => 'category_id'], ]); // Kasacja paragonu nie kasuje operacji, tylko zrywa powiazanie. $this->forge->addForeignKey('receipt_id', 'receipts', 'id', 'SET NULL', 'SET NULL', 'operations_receipt_id_fk'); } public function down(): void { $this->forge->dropForeignKey('operations', 'operations_receipt_id_fk'); $this->forge->dropColumn('operations', 'receipt_id'); } }