created first database migration
This commit is contained in:
@@ -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 {
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user