Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Eloquent: after() not adding column after a certain column

Following code generates column in the end rather after the certain column. I am on Laravel 5.1

public function up()
    {
        Schema::table('project', function (Blueprint $table) {
            $table->enum('is_it',['yes','no'])->after('goals')->nullable();
        });
    }

I am using PostgreSQL 9.4

like image 932
Volatil3 Avatar asked Sep 05 '15 11:09

Volatil3


1 Answers

This is not possible when you are working with PostgreSQL. This function is only supported by MySQL.

In Column Modifiers Documentation, the method after is then only highlighted for MySQL and you can also see a discussion about it here: #14298.

I hope this clarifies your doubt, regards!

like image 125
João Vitor Veronese Vieira Avatar answered Nov 03 '22 16:11

João Vitor Veronese Vieira