MySQL only https://laravel.com/docs/9.x/migrations#column-modifiers
Why does the order of the columns matter at all?
Hey, I'm running a latest laravel 9 application on my local machine. According to the official db migrations doc , I can move a column of a table using the after() method.
Currently I have a posts table in my sqlite3 database and I want to add a new column named 'views' in it. So I normally ran the migration command and in the migration file, I added $table->bigInteger('views')->after('cover')->default(0); line inside the up() method (also provided convenient stuffs to reverse the migration in the down() method).
So after running the php artisan migrate command, and checking the table, I realized that the views column has been created but in wrong order, in the usual order, I mean at the end of the table.
After testing and performing the same process for couple times, I still ain't got no solution or idea that, why it isn't working!
Is that because I'm using sqlite? πππ How can I solve this problem and order my column as I want?
N.B. (Doctrine/Dbal already installed through composer)
Thank You!
Sqlite does not support inserting a column at a specific location. https://stackoverflow.com/questions/4253804/insert-new-column-into-table-in-sqlite/4253879#4253879
Please or to participate in this conversation.