Files
Nexora/database/migrations/2025_04_22_112354_update_projects.php
Javi 88e526cf6c
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
mejoras en la gestión de nombres y códigos de proyectos y documentos según la norma ISO 19650
2025-10-25 11:30:59 +02:00

53 lines
1.7 KiB
PHP

<?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::table('projects', function (Blueprint $table) {
$table->string('reference', 12)->nullable()->after('id')->uniqidue();
$table->string('status')->nullable();
$table->string('project_image_path')->nullable();
$table->string('address')->nullable();
$table->string('province')->nullable();
$table->char('country', 2)->nullable();
$table->string('postal_code', 10)->nullable();
$table->decimal('latitude', 10, 8);
$table->decimal('longitude', 11, 8);
$table->string('icon')->nullable();
$table->date('start_date')->nullable();
$table->date('deadline')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('documents', function (Blueprint $table) {
$table->dropColumn('reference');
$table->dropColumn('status');
$table->dropColumn('project_image_path');
$table->dropColumn('address');
$table->dropColumn('province');
$table->dropColumn('country');
$table->dropColumn('postal_code');
$table->dropColumn('latitude');
$table->dropColumn('longitude');
$table->dropColumn('icon');
$table->dropColumn('start_date');
$table->dropColumn('deadline');
});
}
};