2021-11-27 11:34:20 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Engelsystem\Migrations;
|
|
|
|
|
|
|
|
use Engelsystem\Database\Migration\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
|
|
|
class AddShiftsDescription extends Migration
|
|
|
|
{
|
|
|
|
use Reference;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run the migration
|
|
|
|
*/
|
|
|
|
public function up(): void
|
|
|
|
{
|
2021-11-27 11:43:53 +01:00
|
|
|
if (!$this->schema->hasTable('Shifts')) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-11-27 11:34:20 +01:00
|
|
|
$this->schema->table(
|
|
|
|
'Shifts',
|
|
|
|
function (Blueprint $table): void {
|
|
|
|
$table->text('description')->nullable()->after('shifttype_id');
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migration
|
|
|
|
*/
|
|
|
|
public function down(): void
|
|
|
|
{
|
2021-11-27 11:43:53 +01:00
|
|
|
if (!$this->schema->hasTable('Shifts')) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-11-27 11:34:20 +01:00
|
|
|
$this->schema->table(
|
|
|
|
'Shifts',
|
|
|
|
function (Blueprint $table): void {
|
|
|
|
$table->dropColumn('description');
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|