Add metadata error attrs migration
This commit is contained in:
parent
0ca16459a4
commit
4acebcec7e
@ -13,7 +13,7 @@ class Metadata extends Model
|
|||||||
protected $fillable = ['url', 'title', 'description', 'image', 'expires_at'];
|
protected $fillable = ['url', 'title', 'description', 'image', 'expires_at'];
|
||||||
protected $visible = ['url', 'title', 'description', 'image', 'expires_at', 'tags'];
|
protected $visible = ['url', 'title', 'description', 'image', 'expires_at', 'tags'];
|
||||||
|
|
||||||
protected $dates = ['created_at', 'updated_at', 'expires_at'];
|
protected $dates = ['created_at', 'updated_at', 'expires_at', 'error_at'];
|
||||||
|
|
||||||
public function tags()
|
public function tags()
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddErrorDataToMetadata extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('metadata', function (Blueprint $table) {
|
||||||
|
$table->timestamp('error_at')->nullable();
|
||||||
|
$table->string('error_exception_class')->nullable();
|
||||||
|
$table->integer('error_http_code')->nullable();
|
||||||
|
$table->text('error_body')->nullable();
|
||||||
|
$table->integer('error_count')->default(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('metadata', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['error_at', 'error_exception_class', 'error_http_code', 'error_body', 'error_count']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user