Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Presto's avatar

Modifying Column Type Migration

Ok so I'm trying to modify a column type in my database from a bigInteger to a string, when I run the migration I keep getting an error message saying that there is no column named sku when I can clearly see it is there?!?

Here is my first migration that creates the table

Schema::create('products', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->bigInteger('sku');
    $table->timestamps();
});

Here is my migration to change the column type

Schema::table('products', function (Blueprint $table) {
    $table->string('sku')->change();
});

This is the error

There is no column with name 'sku' on table 'products'.

0 likes
2 replies
Presto's avatar

Thanks for the reply @petrit in my composer.json file, under "require-dev" I have "doctrine/dbal": "2.5.1".

Please or to participate in this conversation.