mardi 9 février 2021

Laravel migration - add new column to exists table

I have some table and I want to add new column to this table. I want add string column with nullable default value.

I try add it like that

Schema::table('table', function (Blueprint $table) {

        $table->addColumn('string', 'label')->nullable()->change();
    });

or

Schema::table('table', function (Blueprint $table) {

        $table->addColumn('string', 'label')->nullable();
    });

but I have this error here is no column with name 'label' on table.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3a4cjqv
via IFTTT

Aucun commentaire:

Enregistrer un commentaire