my-idlers/database/migrations/2022_07_20_011250_add_columns_to_yabs_table.php
cp6 3b9ff1ab85 Possible fix for YABs migration dropping multiple columns error
Possible fix for YABs migration dropping multiple columns error
2022-07-25 10:38:06 +10:00

27 lines
985 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up()
{
Schema::table('yabs', function (Blueprint $table) {
$table->string('uptime')->nullable()->default(null)->after('gb5_id');
$table->string('distro')->nullable()->default(null)->after('gb5_id');
$table->string('kernel')->nullable()->default(null)->after('gb5_id');
$table->float('swap')->nullable()->default(null)->after('ram_mb');
$table->char('swap_type', 2)->nullable()->default(null)->after('ram_mb');
$table->float('swap_mb')->nullable()->default(null)->after('ram_mb');
});
}
public function down()
{
Schema::table('yabs', function (Blueprint $table) {
$table->dropColumn(['uptime', 'distro', 'kernel', 'swap', 'swap_type', 'swap_mb']);
});
}
};