<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('mobile_sync_logs', function (Blueprint $row) {
            $row->id();
            $row->foreignId('user_id')->nullable()->constrained()->onDelete('set null');
            $row->string('platform')->nullable();
            $row->string('device_model')->nullable();
            $row->string('app_version')->nullable();
            $row->string('ip_address')->nullable();
            $row->timestamp('synced_at')->useCurrent();
        });
    }

    public function down()
    {
        Schema::dropIfExists('mobile_sync_logs');
    }
};
