| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- use App\Database\Migrations\TenantMigration;
- return new class extends TenantMigration
- {
- /**
- * Run the migrations.
- */
- public function up(): void
- {
- Schema::create('projects', function (Blueprint $table) {
- $table->id();
- $table->string('name')->nullable();
- $table->string('code')->nullable();
- $table->unsignedBigInteger('customer_id')->nullable();
- $table->foreign('customer_id')->nullable()->references('id')->on('customers')->onUpdate('cascade')->onDelete('cascade');
- $table->unsignedBigInteger('company_service_id')->nullable();
- $table->foreign('company_service_id')->nullable()->references('id')->on('company_services')->onUpdate('cascade')->onDelete('cascade');
- $table->text('description')->nullable();
- $table->date('start_date')->nullable();
- $table->date('end_date')->nullable();
- $table->unsignedBigInteger('project_manager_id')->nullable();
- //$table->foreign('customer_id')->nullable()->references('id')->on('customers')->onUpdate('cascade')->onDelete('cascade');
- $table->decimal('project_value', total: 8, places: 2);
- $table->float('hours')->nullable();
- $table->integer('status')->nullable();
- $table->boolean('billable')->default(1);
- $table->boolean('enabled')->default(1);
- $table->softDeletes();
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('projects');
- }
- };
|