updates
This commit is contained in:
+3
-3
@@ -12,6 +12,7 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
foreach ([
|
||||
'helpdesk_statuses',
|
||||
'helpdesk_priorities',
|
||||
'helpdesk_categories',
|
||||
'helpdesk_projects',
|
||||
@@ -19,9 +20,7 @@ return new class extends Migration
|
||||
] as $table) {
|
||||
if (! Schema::hasColumn($table, 'is_default')) {
|
||||
Schema::table($table, function (Blueprint $table): void {
|
||||
$table->boolean('is_default')
|
||||
->default(false)
|
||||
->after('is_active');
|
||||
$table->boolean('is_default')->default(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -33,6 +32,7 @@ return new class extends Migration
|
||||
public function down(): void
|
||||
{
|
||||
foreach ([
|
||||
'helpdesk_statuses',
|
||||
'helpdesk_priorities',
|
||||
'helpdesk_categories',
|
||||
'helpdesk_projects',
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
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
|
||||
{
|
||||
foreach ([
|
||||
'helpdesk_statuses',
|
||||
'helpdesk_priorities',
|
||||
'helpdesk_categories',
|
||||
'helpdesk_projects',
|
||||
'helpdesk_teams',
|
||||
] as $tableName) {
|
||||
if (Schema::hasTable($tableName) && ! Schema::hasColumn($tableName, 'is_default')) {
|
||||
Schema::table($tableName, static function (Blueprint $table): void {
|
||||
$table->boolean('is_default')->default(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
foreach ([
|
||||
'helpdesk_statuses',
|
||||
'helpdesk_priorities',
|
||||
'helpdesk_categories',
|
||||
'helpdesk_projects',
|
||||
'helpdesk_teams',
|
||||
] as $tableName) {
|
||||
if (Schema::hasTable($tableName) && Schema::hasColumn($tableName, 'is_default')) {
|
||||
Schema::table($tableName, static function (Blueprint $table): void {
|
||||
$table->dropColumn('is_default');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user