api update
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUpdateRequestsTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('update_requests', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
// The user who is requesting profile update
|
||||
$table->unsignedBigInteger('user_id');
|
||||
|
||||
// JSON data of the requested profile changes
|
||||
$table->json('data')->nullable();
|
||||
|
||||
// pending / approved / rejected
|
||||
$table->enum('status', ['pending', 'approved', 'rejected'])->default('pending');
|
||||
|
||||
// Optional message (admin notes)
|
||||
$table->text('admin_note')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
// Foreign key constraint
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('update_requests');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user