Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

declare(strict_types=1);

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('user_verification_tokens', function (Blueprint $table) {
// update column type and add foreign key constraint
$table->foreignId('user_id')->change()
->constrained()
->restrictOnUpdate()
->restrictOnDelete();
});

Schema::table('wiki_managers', function (Blueprint $table) {
// update column type and add foreign key constraint
$table->foreignId('user_id')->change()
->constrained()
->restrictOnUpdate()
->restrictOnDelete();
});

Schema::table('wiki_notification_sent_records', function (Blueprint $table) {
// update column type and add foreign key constraint
$table->foreignId('user_id')->change()
->constrained()
->restrictOnUpdate()
->restrictOnDelete();
});
}

/**
* Reverse the migrations.
*/
public function down(): void {
Schema::table('user_verification_tokens', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->integer('user_id')->change();
});

Schema::table('wiki_managers', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->integer('user_id')->change();
});

Schema::table('wiki_notification_sent_records', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->integer('user_id')->unsigned()->change();
});
}
};
Loading