<?php

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

class ReportWebhook extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        Schema::table('report_organisation_attributes', function (Blueprint $table) {
            $table->dropColumn('minimum_threshold_gbps');
            $table->dropColumn('minimum_threshold_mpps');
        });

        Schema::table('report_organisation_attributes', function (Blueprint $table) {
            $table->boolean('send_webhook')->default(false);

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

    public function down() {
        Schema::table('report_organisation_attributes', function (Blueprint $table) {
            $table->dropColumn('send_webhook');
        });
    }
}
