clrghouz/database/migrations/2023_08_02_203857_netmail_forward.php

31 lines
663 B
PHP
Raw Normal View History

<?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('users',function (Blueprint $table) {
$table->bigInteger('system_id')->nullable();
$table->foreign('system_id')->references('id')->on('systems');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users',function (Blueprint $table) {
$table->dropForeign(['system_id']);
$table->dropColumn('system_id');
});
}
};