-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[8.x] Adds "asRowid" modifier, making a column an alias of "rowid" #35814
Conversation
Thanks for your pull request to Laravel! Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include. If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions! If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response. |
@taylorotwell Sorry to ping you if at the end you still consider this PR to be delayed or anything else. To make it short, every SQLite table (which aren't specifically
Currently, As changing default behavior of |
@Max13 Laravel migrations typically don't work well with SQLite (Think in memory database testing & migrations). However majority of the time I think it's better Laravel does not bend over to accommodate these but rather leave these to be handled by the developer using SQLite. That said, for all it's worth I'd also suggest the method name be |
@ratatatKE I agree with you that these kind of "issues" should be handled by the dev. But, I disagree about this specific issue because (IMO)
Thank you for your idea, I might change the modifier in another commit |
After #35792, I thought the best would be to write a modifier allowing the user to explicitly specify a column as
rowid
.While, IMHO, laravel should implement every increments and id
asRowId
by default, this would be a breaking change in behavior. Maybe for the next major release, we can do the opposite, create a->trueAutoIncrement()
modifier to explicitly use the SQLiteAUTOINCREMENT
mechanism.This modifier won't do anything on other drivers.