remove ref counting, will be replaced by cleanup jobs or triggers
This commit is contained in:
@@ -12,7 +12,6 @@ use Riesjart\Relaquent\Model\Concerns\HasRelaquentRelationships;
|
||||
* @property int $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property int $refs
|
||||
* @property int $ancestor_id
|
||||
* @property string $note
|
||||
* @property object $columns
|
||||
@@ -26,18 +25,6 @@ class Revision extends Model
|
||||
use HasRelaquentRelationships;
|
||||
protected $guarded = [];
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::deleting(function(Revision $self) {
|
||||
// update refcounts
|
||||
$self->rows()->decrement('refs');
|
||||
|
||||
$self->rows()->where('refs', '<=', 0)->delete();
|
||||
});
|
||||
}
|
||||
|
||||
/** Included rows */
|
||||
public function rows()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user