++ Prima versione del designer piantine + Skill grafica
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
// Geometrie dei territori disegnate nell'editor delle piantine: un poligono
|
||||
// per territorio, in GeoJSON (lng/lat). Tabella separata da `territori` di
|
||||
// proposito: il gestionale funziona identico anche senza, e la sotto-app delle
|
||||
// piantine resta rimovibile senza toccare lo schema esistente.
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('territorio_mappe', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('territorio_id')->unique()->constrained('territori')->cascadeOnDelete();
|
||||
$table->longText('geojson');
|
||||
$table->string('image_path')->nullable();
|
||||
$table->timestamp('rendered_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('territorio_mappe');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
// Storico dei PDF dei territori: quando la sotto-app delle piantine sostituisce
|
||||
// un PDF, il file precedente viene spostato qui invece di sparire, e resta
|
||||
// ripristinabile dalla pagina Piantine.
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('territorio_pdf_versioni', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('territorio_id')->constrained('territori')->cascadeOnDelete();
|
||||
$table->string('pdf_path');
|
||||
$table->string('thumbnail_path')->nullable();
|
||||
$table->string('origine')->default('sostituzione');
|
||||
$table->timestamp('sostituito_il');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('territorio_pdf_versioni');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user