<?php

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

class CreateNotationSystemsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('notation_systems', function (Blueprint $table) {
            $table->id();
            $table->string('designation');
            $table->foreignId('brand_id')->constrained('brands')->onDelete('restrict');
            $table->enum('mode_calcul', ['interval', 'multiplicatif'])->default('multiplicatif');
            $table->decimal('montant_reference')->nullable();
            $table->integer('points_reference')->nullable();
            $table->timestamps();
        });
    }

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