Initial commit - construprogress app
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
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('features', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('layer_id')->constrained()->onDelete('cascade');
|
||||
$table->string('name')->nullable();
|
||||
$table->json('geometry'); // GeoJSON geometry object (Point, LineString, Polygon)
|
||||
$table->json('properties')->nullable(); // propiedades extra (progreso, responsable, etc.)
|
||||
$table->foreignId('template_id')->nullable()->constrained('inspection_templates');
|
||||
$table->integer('progress')->default(0);
|
||||
$table->string('responsible')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('features');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user