game-village-politics-backend/database/migrations/2026_11_01_090000_launch_ac...

32 lines
1.1 KiB
PHP
Raw Permalink Normal View History

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
// Accounts accept the terms; players carry their own beginner protection and when they were last seen.
return new class extends Migration
{
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->timestamp('terms_accepted_at')->nullable();
});
Schema::table('players', function (Blueprint $table) {
// Until when nobody may attack them: from joining, and again from a restart.
$table->dateTime('protected_until', 3)->nullable();
$table->dateTime('last_active_at', 3)->nullable()->index();
});
}
public function down(): void
{
Schema::table('players', function (Blueprint $table) {
$table->dropColumn(['protected_until', 'last_active_at']);
});
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('terms_accepted_at');
});
}
};