31 lines
663 B
PHP
31 lines
663 B
PHP
<?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');
|
|
});
|
|
}
|
|
};
|