Skip to content

migration_diff, "collate" is not a valid column option #974

@Rakasch

Description

@Rakasch

I run cakephp 5 with a postgres DB (postgresSQL 18.1).

I added this new column to a table:
Image

I generated a new migration file with the bake tool.

bin/cake bake migration_diff ModPmOrderPositionsAddCPosNr

The generated migation has this up function:

    public function up(): void
    {
        $this->table('mod_pm_order_positions')
            ->addColumn('cpos_nr', 'string', [
                'after' => 'is_optional',
                'collate' => null,
                'comment' => 'Nummerierung für die Anzeige',
                'default' => null,
                'length' => 30,
                'null' => true,
            ])
            ->update();
    }

When I try to use the migration

bin/cake migrations migrate

I get the following error: "collate" is not a valid column option."
Image

If I manually delete the collate option from the migration, it works fine.

Currenlty I would have to manually delete that 'collate' => null from each autogenerated migration.
Could you fix the bake script, so the generated migration does not throw an error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions