<?php

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

class ReportPreferences extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('report_organisation_attributes', function (Blueprint $table) {
            // General characteristics - PK, timestamps, soft-deletable
            $table->id();
            $table->timestamps();

            // Foreign identifiers
            $table->foreignId('organisation_id')->cascadeOnDelete()->constrained('organisations');

            // Characteristics
            $table->tinyInteger('send_individual')->nullable();
            $table->tinyInteger('send_carpet')->nullable();
            $table->tinyInteger('send_daily')->nullable();
            $table->tinyInteger('send_weekly')->nullable();
            $table->tinyInteger('send_monthly')->nullable();
            $table->tinyInteger('send_quarterly')->nullable();

            $table->integer('minimum_threshold_gbps')->nullable();
            $table->integer('minimum_threshold_mpps')->nullable();
        });
    }

    public function down() {
        Schema::dropIfExists('report_organisation_attributes');
    }
}
