move into sonardesk
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?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('event_venues', function (Blueprint $t): void {
|
||||
$t->id();
|
||||
$t->string('name');
|
||||
$t->text('address')->nullable();
|
||||
$t->unsignedInteger('capacity')->nullable();
|
||||
$t->timestamps();
|
||||
});
|
||||
Schema::create('events', function (Blueprint $t): void {
|
||||
$t->id();
|
||||
$t->foreignId('venue_id')->nullable()->constrained('event_venues')->nullOnDelete();
|
||||
$t->string('title');
|
||||
$t->string('slug')->unique();
|
||||
$t->text('summary')->nullable();
|
||||
$t->longText('description')->nullable();
|
||||
$t->timestamp('starts_at')->index();
|
||||
$t->timestamp('ends_at')->nullable();
|
||||
$t->string('status')->default('draft')->index();
|
||||
$t->unsignedInteger('capacity')->nullable();
|
||||
$t->decimal('price', 10, 2)->default(0);
|
||||
$t->boolean('registration_open')->default(false);
|
||||
$t->timestamps();
|
||||
});
|
||||
Schema::create('event_registrations', function (Blueprint $t): void {
|
||||
$t->id();
|
||||
$t->foreignId('event_id')->constrained()->cascadeOnDelete();
|
||||
$t->string('name');
|
||||
$t->string('email')->index();
|
||||
$t->unsignedInteger('quantity')->default(1);
|
||||
$t->string('status')->default('confirmed')->index();
|
||||
$t->text('notes')->nullable();
|
||||
$t->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_registrations');
|
||||
Schema::dropIfExists('events');
|
||||
Schema::dropIfExists('event_venues');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user