40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?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->id();
|
|
$table->foreignId('project_id')->constrained()->cascadeOnDelete();
|
|
$table->foreignId('ticket_type_id')->constrained()->cascadeOnDelete();
|
|
$table->foreignId('ticket_priority_id')->constrained()->cascadeOnDelete();
|
|
$table->foreignId('board_column_id')->nullable()->constrained()->nullOnDelete();
|
|
$table->unsignedInteger('sequence_number');
|
|
$table->string('ticket_key')->unique();
|
|
$table->string('title');
|
|
$table->text('description')->nullable();
|
|
$table->text('acceptance_criteria')->nullable();
|
|
$table->unsignedInteger('story_points')->nullable()->default(null);
|
|
$table->timestamps();
|
|
|
|
$table->unique(['project_id', 'sequence_number']);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('tickets');
|
|
}
|
|
};
|