diff --git a/app/Metadata.php b/app/Metadata.php index 2abd321..546f155 100644 --- a/app/Metadata.php +++ b/app/Metadata.php @@ -13,7 +13,7 @@ class Metadata extends Model protected $fillable = ['url', 'title', 'description', 'image', 'expires_at']; 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() { diff --git a/database/migrations/2020_08_10_114944_add_error_data_to_metadata.php b/database/migrations/2020_08_10_114944_add_error_data_to_metadata.php new file mode 100644 index 0000000..2938ccd --- /dev/null +++ b/database/migrations/2020_08_10_114944_add_error_data_to_metadata.php @@ -0,0 +1,36 @@ +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']); + }); + } +}