ligiapretel / guardioes_pet

0 stars 0 forks source link

Migration de Pets #2

Open alinenaoe opened 4 years ago

alinenaoe commented 4 years ago
<?php

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

class CreatePetsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pets', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name',300);
            $table->string('type',300);
            $table->string('sex',2);
            $table->string('animal_bearing',30);
            $table->string('coal_type',300);
            $table->string('breed',300);
            $table->integer('age');
            $table->boolean('castration');
            $table->boolean('vaccinated');
            $table->boolean('deworming');
            $table->text('description',5000);
            $table->boolean('docile');
            $table->boolean('like_affection');
            $table->boolean('like_children');
            $table->boolean('live_well_with_animals');
            $table->boolean('like_to_play');
            $table->boolean('well_behaved');
            $table->boolean('adoption_available');
            $table->boolean('temporary_home_available');
            $table->boolean('sponsorship_available');
            $table->string('status',300);
            $table->unsignedBigInteger('id_ngo');
            $table->foreign('id_ngo')->references('id')->on('NGOs');
            $table->timestamps();
        });
    }

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