2017-03-10 23:25:12 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class AddNewServiceOptionsColumns extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*/
|
2022-11-25 20:29:04 +00:00
|
|
|
public function up(): void
|
2017-03-10 23:25:12 +00:00
|
|
|
{
|
2017-03-12 22:26:36 +00:00
|
|
|
Schema::table('service_options', function (Blueprint $table) {
|
|
|
|
$table->dropColumn('executable');
|
2017-03-10 23:25:12 +00:00
|
|
|
|
2017-03-12 22:26:36 +00:00
|
|
|
$table->unsignedInteger('config_from')->nullable()->after('docker_image');
|
|
|
|
$table->string('config_stop')->nullable()->after('docker_image');
|
|
|
|
$table->text('config_logs')->nullable()->after('docker_image');
|
|
|
|
$table->text('config_startup')->nullable()->after('docker_image');
|
|
|
|
$table->text('config_files')->nullable()->after('docker_image');
|
2017-03-10 23:25:12 +00:00
|
|
|
|
2017-03-12 22:26:36 +00:00
|
|
|
$table->foreign('config_from')->references('id')->on('service_options');
|
2017-03-10 23:25:12 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*/
|
2022-11-25 20:29:04 +00:00
|
|
|
public function down(): void
|
2017-03-10 23:25:12 +00:00
|
|
|
{
|
2017-03-12 22:26:36 +00:00
|
|
|
Schema::table('service_options', function (Blueprint $table) {
|
2017-04-19 22:43:32 +00:00
|
|
|
$table->dropForeign(['config_from']);
|
2017-03-10 23:25:12 +00:00
|
|
|
|
2017-03-12 22:26:36 +00:00
|
|
|
$table->dropColumn('config_from');
|
|
|
|
$table->dropColumn('config_stop');
|
|
|
|
$table->dropColumn('config_logs');
|
|
|
|
$table->dropColumn('config_startup');
|
|
|
|
$table->dropColumn('config_files');
|
2017-03-10 23:25:12 +00:00
|
|
|
|
2017-03-12 22:26:36 +00:00
|
|
|
$table->string('executable')->after('docker_image')->nullable();
|
2017-03-10 23:25:12 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|