OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Migration: renameColumn + addIndex ?

This topic contains 2 replies, has 2 voices, and was last updated by  Rodolfo 5 years, 2 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #33898



    I need to rename a field and add an index to it. Using migrations it only works if I run the command oro:migration:load twice. On the first run it complains that I don’t have the new renamed field name.

    I tried to rename it in one migration version (v1_1) and add the index in other migration version (v1_2) but I’m still getting error. It only works if I run the command twice.

    ** I’m using $this->renameExtension->renameColumn inside my up() migration method.

    Any idea how can I solve it and run the command only once?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #33899


    Hi, @rbandeira!

    RenameExtension uses queries, $queries->addQuery($renameQuery); so you need to add your index using
    $queries->addPostQuery($addIndexSql) to make them executed one by one



    Thank you @sergey_zhuravel

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No