%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/hrsys/api/database/migrations/
Upload File :
Create Path :
Current File : /var/www/html/hrsys/api/database/migrations/2020_03_20_205307_create_projects_table.php

<?php

use App\Models\Project;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProjectsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('projects', function (Blueprint $table) {
            $table->id();
            $table->string('code')
                  ->unique();
            $table->string('name');
            $table->date('start_date');
            $table->date('end_date')
                  ->nullable();
            $table->integer('estimation');
            $table->integer('price');
            $table->string('currency')
                  ->default(Project::EURO);
            $table->text('notes')
                  ->nullable();
            $table->unsignedBigInteger('client_id')
                  ->index();
            $table->foreign('client_id')
                  ->references('id')
                  ->on('clients');
            $table->unsignedBigInteger('manager_id')
                  ->index();
            $table->foreign('manager_id')
                  ->references('id')
                  ->on('users');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('projects');
    }
}

Zerion Mini Shell 1.0