a bit of progress
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?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('cooldowns', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('character_id')->constrained('characters')->onDelete('cascade');
|
||||
$table->string('action_type'); // attack, crime, travel, train, etc.
|
||||
$table->timestamp('last_action_at')->useCurrent();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['character_id', 'action_type']);
|
||||
$table->index('character_id');
|
||||
$table->index('action_type');
|
||||
$table->index('last_action_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cooldowns');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user