feat: add ColumnComment model and migration for tracking field-level comments

This commit is contained in:
Ümit Tunç
2026-04-28 23:21:00 +03:00
parent b59ad54511
commit 8243ae831f
2 changed files with 69 additions and 0 deletions
@@ -0,0 +1,39 @@
<?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
{
if (!Schema::hasTable('column_comments')) {
Schema::create('column_comments', function (Blueprint $table) {
$table->id();
$table->string('table_name');
$table->unsignedBigInteger('record_id');
$table->string('column_name');
$table->text('comment');
$table->text('column_value')->nullable();
$table->unsignedBigInteger('user_id')->nullable();
$table->string('ip_address', 45)->nullable();
$table->timestamps();
$table->index(['table_name', 'record_id']);
$table->index(['table_name', 'column_name']);
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('column_comments');
}
};