Add Activity Model/Migration

pull/460/head
Daniel Supernault 2018-09-11 18:47:25 -06:00
rodzic dee02d7353
commit a8b6002c0b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
2 zmienionych plików z 46 dodań i 0 usunięć

10
app/Activity.php 100644
Wyświetl plik

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

Wyświetl plik

@ -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');
}
}