Files
Nexora/database/migrations/2025_04_22_112354_update_projects.php

53 lines
1.7 KiB
PHP
Raw Normal View History

2025-04-23 00:14:33 +06:00
<?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();
2025-04-23 00:14:33 +06:00
$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');
2025-04-23 00:14:33 +06:00
$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');
});
}
};