<?php

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

class CreateHomes extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('homes', function (Blueprint $table) {
            $table->id();
            $table->string('title')->comment('A title');
            $table->integer('price')->comment('Total price of the house');
            $table->integer('surface')->comment('Home surface');
            $table->integer('garden_surface')->nullable()->comment('Garden surface');
            $table->integer('rooms')->nullable()->comment('How many rooms');
            $table->char('energy')->nullable()->comment('Energy Economy');
            $table->char('ges')->nullable()->comment('GES');
            $table->text('description')->nullable()->comment('description of the house');
            $table->string('city')->comment('City');
            $table->json('pictures')->nullable()->comment('List of photos');
            $table->json('map')->nullable()->comment('lat and lng');
            $table->string('url')->comment('Origin');
            $table->timestamps();
        });
    }

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