mirror of
https://github.com/twinpath/app.git
synced 2026-01-26 05:15:28 +07:00
chore: cleanup project structure and update readme for beta release
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?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('tickets', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('user_id', 32)->index();
|
||||
$table->string('ticket_number')->unique();
|
||||
$table->string('subject');
|
||||
$table->string('category'); // Technical, Billing, etc.
|
||||
$table->enum('priority', ['low', 'medium', 'high'])->default('medium');
|
||||
$table->enum('status', ['open', 'answered', 'closed'])->default('open');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
});
|
||||
|
||||
Schema::create('ticket_replies', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->foreignUuid('ticket_id')->constrained()->onDelete('cascade');
|
||||
$table->string('user_id', 32)->index();
|
||||
$table->text('message');
|
||||
$table->string('attachment_path')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ticket_replies');
|
||||
Schema::dropIfExists('tickets');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user