Tidy up migrations: consolidate and delete redundant files

This commit is contained in:
dyzulk
2025-12-30 19:51:45 +07:00
parent 452adb936b
commit a14d788400
4 changed files with 2 additions and 70 deletions

View File

@@ -16,6 +16,7 @@ return new class extends Migration
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('email')->unique();
$table->string('pending_email')->nullable();
$table->timestamp('email_verified_at')->nullable();
$table->string('password')->nullable();

View File

@@ -35,7 +35,7 @@ return new class extends Migration
$table->text('change_log')->nullable();
$table->boolean('is_active')->default(true); // Internal Soft delete/archive
$table->unsignedBigInteger('created_by')->nullable();
$table->uuid('created_by')->nullable();
$table->timestamps();
});
}

View File

@@ -1,41 +0,0 @@
<?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
{
// Fix column type mismatch for created_by (Int -> UUID)
if (Schema::hasColumn('legal_page_revisions', 'created_by')) {
Schema::table('legal_page_revisions', function (Blueprint $table) {
$table->dropColumn('created_by');
});
}
Schema::table('legal_page_revisions', function (Blueprint $table) {
$table->uuid('created_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
if (Schema::hasColumn('legal_page_revisions', 'created_by')) {
Schema::table('legal_page_revisions', function (Blueprint $table) {
$table->dropColumn('created_by');
});
}
Schema::table('legal_page_revisions', function (Blueprint $table) {
$table->unsignedBigInteger('created_by')->nullable();
});
}
};

View File

@@ -1,28 +0,0 @@
<?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 $label) {
$label->string('pending_email')->nullable()->after('email');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $label) {
$label->dropColumn('pending_email');
});
}
};