remove ref counting, will be replaced by cleanup jobs or triggers

This commit is contained in:
2018-07-22 06:47:59 +02:00
parent e01c63cfa2
commit 9081b38425
7 changed files with 3 additions and 53 deletions
-17
View File
@@ -35,23 +35,6 @@ class Table extends Model
use Reportable;
protected $guarded = [];
protected static function boot()
{
parent::boot();
static::deleting(function(Table $self) {
// update revision refcounts
$self->revisions()->decrement('refs');
$self->reportsOf()->delete();
// delete revisions with zero refs (manually, to properly cascade to rows)
foreach ($self->revisions()->where('refs', '<=', 0)->get() as $rev) {
$rev->delete();
}
});
}
/** Owning user */
public function owner()
{