mirror of
https://github.com/dyzulk/trustlab-api.git
synced 2026-01-26 05:15:35 +07:00
Tidy up migrations: consolidate and delete redundant files
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user