<?php

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

class UpdateUsers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
		Schema::table('users', function (Blueprint $table) {
			$table->text('pgp_pubkey')->nullable();
			$table->boolean('active')->default(TRUE);
			$table->dateTime('last_on')->nullable();
		});

		Schema::table('systems', function (Blueprint $table) {
			$table->dateTime('last_session')->nullable();
		});
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
		Schema::table('users', function (Blueprint $table) {
			$table->dropColumn(['pgp_pubkey','active','last_on']);
		});

		Schema::table('systems', function (Blueprint $table) {
			$table->dropColumn(['last_session']);
		});
    }
}