-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with renaming deleted_at column inside model #2248
Comments
It looks to me like it is actually choking on escaping your |
Here it is:
protected $DBGroup = 'default';
protected $table = 'users';
protected $primaryKey = 'id';
protected $returnType = 'array';
protected $useSoftDeletes = true;
protected $allowedFields = [
'name',
'email',
'country'
];
protected $useTimestamps = true;
protected $dateFormat = 'int';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
protected $validationRules = [
'name' =>'required|min_length[5]|max_length[32]',
'email'=>'required|valid_email|is_unique[users.email]',
'country'=>'required|alpha|exact_length[2]'
];
protected $validationMessages = [];
protected $skipValidation = false;
thank you
Marco
Op di 24 sep. 2019 om 16:34 schreef MGatner <[email protected]>:
… It looks to me like it is actually choking on escaping your $deletedField.
Can you paste or PasteBin the top of your model file?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2248?email_source=notifications&email_token=AIN2TH3URGZ5U572UQ2TQTLQLIQQLA5CNFSM4IY6SKQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7OSS5I#issuecomment-534587765>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIN2THZEQOXI2Q6JY3ARAALQLIQQLANCNFSM4IY6SKQA>
.
|
The default value for this field supposed to be When SELECT * FROM `table` WHERE `table`.`deleted_at` IS NULL Maybe we could consider introducing a The truth is it could be beneficial for some people with big data sets since it would use less data and index space. But I don't have a strong opinion about this potential change. |
I hesitate to add yet another setting. I think unless we see this becoming a bigger problem we roll with it the way it currently is, where it checks for |
If you use useSoftDelete and Dateformate as php timestamps inside a model a errornous sql will be created. I created an integer column with default value 0. The created sql from a find request to get the rows from the model is select * from users where <> is null, which results in a empty array.
The text was updated successfully, but these errors were encountered: