Support the ongoing development of Laravel.io →
posted 10 years ago
Database
Last updated 2 years ago.
0

I have been looking in the source of the BluePrint class. There is no method like "alterColumn" or "changeColumn" :(

Last updated 2 years ago.
0

someone told me I have to use raw queries:

    public function up() {
        DB::statement('ALTER TABLE `users` MODIFY COLUMN `password` VARCHAR(100)');
    }
Last updated 2 years ago.
0

In Laravel 5.2 you can do something like this:

Schema::table('users', function ($table) { $table->string('name', 50)->change(); });

https://laravel.com/docs/5.2/migrations

0

Sign in to participate in this thread!

Eventy

Your banner here too?

eschmid72 eschmid72 Joined 4 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.