mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
Fix deleting database host when it has assigned nodes (#899)
* Cascade delete from database_host_node when the database host is deleted * Update database/migrations/2025_01_09_143607_database_host_node_foreign_delete_cascade.php Remove migration rollback Co-authored-by: MartinOscar <40749467+RMartinOscar@users.noreply.github.com> * Update 2025_01_09_143607_database_host_node_foreign_delete_cascade.php Fix brace position --------- Co-authored-by: MartinOscar <40749467+RMartinOscar@users.noreply.github.com>
This commit is contained in:
parent
9cfd87090f
commit
d088e79e5e
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('database_host_node', function (Blueprint $table) {
|
||||||
|
$table->dropForeign(['database_host_id']);
|
||||||
|
$table->foreign('database_host_id')->references('id')->on('database_hosts')->cascadeOnDelete();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void {}
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user