created first database migration

This commit is contained in:
2019-11-17 09:27:51 -06:00
parent 2c6543185d
commit 95887e9594
3 changed files with 72 additions and 4 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace App\Library\Timer;
/**
* This library performs some of the calculations needed to be done
* repeatedly for the timer board.
*/
//Internal Libraries
use DB;
use Log;
use Carbon\Carbon;
//Models
//Application Libraries
class TimerHelper {
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Models\Timers;
use Illuminate\Database\Eloquent\Model;
class Timer extends Model
{
// Table Name
protected $table = 'timer';
//Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'type',
'stage',
'region',
'system',
'planet',
'moon',
'owner',
'owner_id',
'eveTime',
'notes',
'character_id',
];
}
@@ -13,10 +13,23 @@ class CreateTimersTable extends Migration
*/
public function up()
{
Schema::create('timers', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
});
if(!Schema::hasTable('timers')) {
Schema::create('timers', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('type');
$table->string('stage');
$table->string('region');
$table->string('sytem');
$table->string('planet');
$table->string('moon');
$table->string('owner');
$table->unsignedInteger('owner_id');
$table->dateTime('eveTime');
$table->text('notes');
$table->unsignedInteger('character_id');
$table->timestamps();
});
}
}
/**