29 lines
829 B
PHP
29 lines
829 B
PHP
<?php
|
|||
|
|
|
||
|
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
|
||
|
|
return new class extends Migration
|
||
|
|
{
|
||
|
|
public function up(): void
|
||
|
|
{
|
||
|
|
Schema::create('annotations', function (Blueprint $table) {
|
||
|
|
$table->id();
|
||
|
|
$table->foreignId('website_id')->constrained()->cascadeOnDelete();
|
||
|
|
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||
|
|
$table->date('date');
|
||
|
|
$table->string('text');
|
||
|
|
$table->string('category')->default('general'); // general, deployment, campaign, incident
|
||
|
|
$table->timestamps();
|
||
|
|
|
||
|
|
$table->index(['website_id', 'date']);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(): void
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('annotations');
|
||
|
|
}
|
||
|
|
};
|