Files
ntspi-app/database/migrations/2024_03_13_214325_create_events_table.php
T
2024-09-19 16:06:49 +05:00

38 lines
1.0 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('events', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('slug')->unique();
$table->text('content');
$table->date('event_date_start');
$table->date('event_date_end')->nullable();
$table->time('event_time_start');
$table->string('address')->nullable();
$table->boolean('is_online');
$table->unsignedBigInteger('category_id')->nullable();
$table->foreign('category_id')->references('id')->on('event_categories');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('events');
}
};