Initial project

This commit is contained in:
2026-05-01 00:41:02 +03:30
parent d324115341
commit cde71d5761
172 changed files with 22074 additions and 12 deletions

View File

@@ -0,0 +1,36 @@
<?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::create('messages', function (Blueprint $table) {
$table->id();
$table->foreignId('conversation_id')->constrained()->cascadeOnDelete();
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete();
$table->string('type')->default('text')->index();
$table->text('body');
$table->json('metadata')->nullable();
$table->timestamp('edited_at')->nullable();
$table->timestamps();
$table->index(['conversation_id', 'created_at']);
$table->index(['user_id', 'created_at']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('messages');
}
};