What will happen to the related data when I softdeletes a user? For example I have a donations table where we tracks all the donations given by the users for each campaigns.
public function user()
{
return $this->belongsTo('App\User');
}
Schema of donations table
Schema::create('donations', function(Blueprint $table)
{
$table->increments('id');
$table->integer('campaign_id');
$table->integer('user_id');
$table->float('amount');
$table->timestamps();
});
So if a user a softdeleted then how the total amount for a campaign is going to get affected. Also there is a comments table which tracks all the comments used by the user. We are using softdelete so that we can reactivate the account later. Is this a good method in the current scenario or can I use a status field in the users table to deactivate or reactivate users.
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1U439x7
via IFTTT
Aucun commentaire:
Enregistrer un commentaire