29 lines
865 B
PHP
29 lines
865 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
|
||
|
|
return new class extends Migration
|
||
|
|
{
|
||
|
|
public function up()
|
||
|
|
{
|
||
|
|
Schema::create('projects', function (Blueprint $table) {
|
||
|
|
$table->id();
|
||
|
|
$table->string('name');
|
||
|
|
$table->text('address');
|
||
|
|
$table->decimal('lat', 10, 8);
|
||
|
|
$table->decimal('lng', 11, 8);
|
||
|
|
$table->date('start_date');
|
||
|
|
$table->date('end_date_estimated')->nullable();
|
||
|
|
$table->enum('status', ['planning', 'in_progress', 'paused', 'completed'])->default('planning');
|
||
|
|
$table->foreignId('created_by')->constrained('users');
|
||
|
|
$table->timestamps();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down()
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('projects');
|
||
|
|
}
|
||
|
|
};
|