Add Activity Model/Migration

This commit is contained in:
Daniel Supernault 2018-09-11 18:47:25 -06:00
parent dee02d7353
commit a8b6002c0b
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 46 additions and 0 deletions

10
app/Activity.php Normal file
View file

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Activity extends Model
{
protected $dates = ['processed_at'];
}

View file

@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateActivitiesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('activities', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('to_id')->unsigned()->nullable();
$table->bigInteger('from_id')->unsigned()->nullable();
$table->string('object_type')->nullable();
$table->json('data')->nullable();
$table->timestamp('processed_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('activities');
}
}