%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/geotechnics/api/database/migrations/
Upload File :
Create Path :
Current File : /var/www/html/geotechnics/api/database/migrations/2019_09_07_100147_create_services_table.php

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateServicesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('services', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('description');
            $table->string('long_description');
            $table->string('price')
                  ->nullable();
            $table->boolean('is_available')
                  ->default(false);
            $table->unsignedBigInteger('client_id')
                  ->nullable()
                  ->index();
            $table->foreign('client_id')
                  ->references('id')
                  ->on('users');
            $table->unsignedBigInteger('category_id')
                  ->nullable()
                  ->index();
            $table->foreign('category_id')
                  ->references('id')
                  ->on('categories');
            $table->timestamps();
        });
    }

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

Zerion Mini Shell 1.0