2022-07-21 23:50:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
class AddCancelationToServersTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
2023-05-08 09:10:51 +00:00
|
|
|
// User already has installed the addon before
|
|
|
|
if (Schema::hasColumn("servers", "cancelled")) {
|
2023-06-08 14:10:42 +00:00
|
|
|
Schema::table('servers', function (Blueprint $table) {
|
|
|
|
$table->renameColumn('cancelled', 'canceled');
|
|
|
|
});
|
2023-05-08 09:10:51 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-07-21 23:50:45 +00:00
|
|
|
Schema::table('servers', function (Blueprint $table) {
|
2023-06-08 18:23:06 +00:00
|
|
|
$table->dateTime('canceled')->nullable();
|
2022-07-21 23:50:45 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::table('servers', function (Blueprint $table) {
|
2023-06-08 14:10:42 +00:00
|
|
|
$table->dropColumn('canceled');
|
2022-07-21 23:50:45 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|