<?php

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

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 100);
            $table->string('surnames', 200);
            $table->string('phone', 50)->nullable();
            $table->string('email', 100)->unique()->index();
            $table->string('nif', 100)->unique()->index();
            $table->date('date_of_birth');
            $table->string('address', 100);
            $table->string('zipcode', 100);
            $table->string('poblacio', 100);
            $table->string('country', 100);
            $table->string('url_profile_photo', 300)->nullable();
            $table->float('weight', 8, 2)->nullable();
            $table->float('height', 8, 2)->nullable();
            $table->string('gender', 10)->nullable();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password', 255);
            $table->rememberToken();
            $table->string('one_signal_player_id', 255)->nullable();
            $table->timestamps();
        });
    }

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