This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/database/2016_12_09_225434_status_tables.php
2016-12-09 23:28:25 +01:00

44 lines
1.2 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Sakura\DB;
class StatusTables extends Migration
{
/**
* Run the migrations.
* @return void
*/
public function up()
{
$schema = DB::getSchemaBuilder();
$schema->create('status_history', function (Blueprint $table) {
$table->string('history_name');
$table->smallInteger('history_port')->unsigned();
$table->string('history_protocol');
$table->tinyInteger('history_state')->unsigned();
$table->timestamp('history_date')->useCurrent = true;
});
$schema->create('status_events', function (Blueprint $table) {
$table->increments('event_id');
$table->timestamp('event_date')->useCurrent = true;
$table->tinyInteger('event_state')->unsigned();
$table->string('event_text');
});
}
/**
* Reverse the migrations.
* @return void
*/
public function down()
{
$schema = DB::getSchemaBuilder();
$schema->drop('status_history');
$schema->drop('status_events');
}
}