Files
newznab-tmux/database/migrations/2025_05_04_212955_drop_userseed.php
T
DariusIII 773bc5a9e9 CS fix
2025-05-06 11:51:47 +02:00

36 lines
914 B
PHP

<?php
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
{
Schema::table('users', function (Blueprint $table) {
// Check if the column exists before dropping it
if (Schema::hasColumn('users', 'userseed')) {
// Drop the column if it exists
$table->dropColumn('userseed');
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
// Add the column back if it doesn't exist
if (! Schema::hasColumn('users', 'userseed')) {
$table->string('userseed')->nullable();
}
});
}
};