Explorar el Código

Fix foreign key

Alan Lam hace 3 años
padre
commit
5456edba7d

+ 12 - 0
db/migrations/20230316122259_fix_user_location_reject_foreign_key.php

@@ -0,0 +1,12 @@
+<?php
+
+use Phinx\Migration\AbstractMigration;
+
+class FixUserLocationRejectForeignKey extends AbstractMigration {
+	public function change() {
+		$this->table("user_location_reject")
+			->dropForeignKey("location_id")
+			->addForeignKey("location_id", "location", "id", ["update" => "CASCADE", "delete" => "CASCADE"])
+			->update();
+	}
+}