forged-plugs/announcements/database/migrations/001_create_announcements_table.php

28 lines
763 B
PHP
Raw Normal View History

<?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('announcements', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->string('body')->nullable();
$table->string('type')->default('info');
$table->json('panels')->nullable();
$table->timestamp('valid_from')->nullable();
$table->timestamp('valid_to')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('announcements');
}
};