first commit

This commit is contained in:
furen81
2026-01-23 19:18:52 +07:00
commit 6e681c4ad3
80 changed files with 13874 additions and 0 deletions

View File

@ -0,0 +1,37 @@
<?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('waypoints', function (Blueprint $table) {
$table->id();
$table->foreignId('sales_route_id')->constrained()->cascadeOnDelete();
$table->enum('type', ['checkin', 'checkout', 'gps', 'lunch', 'visit']);
$table->decimal('latitude', 10, 8);
$table->decimal('longitude', 11, 8);
$table->timestamp('recorded_at');
$table->string('location_name', 200)->nullable();
$table->text('address')->nullable();
$table->text('notes')->nullable();
$table->string('photo_url', 500)->nullable();
$table->timestamps();
$table->index(['sales_route_id', 'recorded_at']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('waypoints');
}
};