<?php
/* 
 * Migrations generated by: Skipper (http://www.skipper18.com)
 * Migration id: 96874bd5-3799-4630-8c7c-1dc8f1a6f4f3
 * Migration datetime: 2022-03-11 16:54:12.298044
 */ 

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

class SkipperMigrations2022031116541229 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('azienda', function (Blueprint $table) {
            $table->boolean('is_attivo')->nullable(true)->after('intestazione');
        });
        Schema::table('azienda', function (Blueprint $table) {
            $table->boolean('default')->nullable(true)->after('redmine_url');
        });
        /* Reordering of existing columns is not supported by Laravel Eloquent.
        Schema::table('azienda', function (Blueprint $table) {
            $table->moveColumnAfter('created_at', 'default');
        });
        */
        
        /* But you can create your own migrations with following SQL query based on your target SQL engine.
        DB::transaction(function () {
            DB::statement('ALTER TABLE `azienda` MODIFY `created_at` [COLUMN_DEF] AFTER `default`');
        });
        */
    }
    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        /* Reordering of existing columns is not supported by Laravel Eloquent.
        Schema::table('azienda', function (Blueprint $table) {
            $table->moveColumnAfter('created_at', 'redmine_url');
        });
        */
        
        /* But you can create your own migrations with following SQL query based on your target SQL engine.
        DB::transaction(function () {
            DB::statement('ALTER TABLE `azienda` MODIFY `created_at` [COLUMN_DEF] AFTER `redmine_url`');
        });
        */
        Schema::table('azienda', function (Blueprint $table) {
            $table->dropColumn('default');
        });
        Schema::table('azienda', function (Blueprint $table) {
            $table->dropColumn('is_attivo');
        });
    }
}
