Hi, you can use this instead:
DB::statement('ALTER TABLE users ADD mobile VARCHAR(13) );
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a table with mixed case column names. When I try to alter a column, migration calls Doctrine\Dbal and it can't find the lower case version of the column. I've looked high and low for a way around this. No luck.
So I want to alter my table/column myself:
DB::table('user')->select(DB::raw('alter table `user` alter column `TCAccess` set default 0'));
The above doesn't work, and with an enabled query log, the DB::getQueryLog() returns an empty array.
Is there a way to execute the sql shown inside the DB::raw call above?
Thanks,
Ed G
Please or to participate in this conversation.