<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('ynh_servers', function (Blueprint $table) {
            $table->foreignId('ynh_order_id')->nullable()->constrained()->nullOnDelete();
        });
        Schema::table('ynh_applications', function (Blueprint $table) {
            $table->foreignId('ynh_order_id')->nullable()->constrained()->nullOnDelete();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('ynh_applications', function (Blueprint $table) {
            $table->foreignId('ynh_order_id')->nullable()->constrained()->nullOnDelete();
        });
        Schema::table('ynh_servers', function (Blueprint $table) {
            $table->foreignId('ynh_order_id')->nullable()->constrained()->nullOnDelete();
        });
    }
};
