2017-04-27 16:16:57 -04:00
|
|
|
<?php
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2017-04-27 16:16:57 -04:00
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2026-10-05 18:10:18 -04:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
2017-04-27 16:16:57 -04:00
|
|
|
|
|
|
|
|
class AddCopyScriptFromColumn extends Migration
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Run the migrations.
|
|
|
|
|
*/
|
2024-10-21 19:18:20 -06:00
|
|
|
public function up(): void
|
2017-04-27 16:16:57 -04:00
|
|
|
{
|
2026-10-05 18:10:18 -04:00
|
|
|
Schema::table('service_options', function (Blueprint $table): void {
|
2017-04-27 16:16:57 -04:00
|
|
|
$table->unsignedInteger('copy_script_from')->nullable()->after('script_container');
|
|
|
|
|
|
|
|
|
|
$table->foreign('copy_script_from')->references('id')->on('service_options');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reverse the migrations.
|
|
|
|
|
*/
|
2024-10-21 19:18:20 -06:00
|
|
|
public function down(): void
|
2017-04-27 16:16:57 -04:00
|
|
|
{
|
2026-10-05 18:10:18 -04:00
|
|
|
Schema::table('service_options', function (Blueprint $table): void {
|
2017-04-27 16:16:57 -04:00
|
|
|
$table->dropForeign(['copy_script_from']);
|
|
|
|
|
$table->dropColumn('copy_script_from');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|