feat(event): add date reschedule history
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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_date_reschedules', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->string('tenant_code');
|
||||
$table->foreignId('source_event_date_id')->nullable()->constrained('event_dates')->nullOnDelete();
|
||||
$table->foreignId('destination_event_date_id')->nullable()->constrained('event_dates')->nullOnDelete();
|
||||
$table->foreignId('created_by_user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->date('previous_date');
|
||||
$table->date('new_date');
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
|
||||
$table->foreign('tenant_code')
|
||||
->references('codigo')
|
||||
->on('tenants')
|
||||
->cascadeOnUpdate()
|
||||
->cascadeOnDelete();
|
||||
$table->index(['tenant_code', 'created_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_date_reschedules');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user