Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to 2.o mysql error: 1060 Duplicate column name image_attribute_id #140

Open
e1th0r opened this issue Jun 5, 2018 · 2 comments

Comments

@e1th0r
Copy link

e1th0r commented Jun 5, 2018

Hi.

Triying to update from 1.7 to 2.0.25 fails with error:

[Akeneo\PimMigration\Domain\MigrationStep\s080_FamilyMigration\FamilyMigrationException] Error: Step 9 - Family Migration: Query "ALTER TABLE pim_catalog_family ADD COLUMN image_ attribute_id INT(11) DEFAULT NULL AFTER label_attribute_id, ADD CONSTRAINT `FK_90632072BC 295696` FOREIGN KEY (`image_attribute_id`) REFERENCES `pim_catalog_attribute` (`id`) ON D ELETE SET NULL, ADD KEY `IDX_90632072BC295696` (`image_attribute_id`)" occured an error : SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'image_attribute_id'

[Akeneo\PimMigration\Domain\DataMigration\QueryException] Query "ALTER TABLE pim_catalog_family ADD COLUMN image_attribute_id INT(11) DEFAULT NULL AFTER label_attribute_id, ADD CONSTRAINT `FK_90632072BC295696` FOREIGN KEY (`image_attrib ute_id`) REFERENCES `pim_catalog_attribute` (`id`) ON DELETE SET NULL, ADD KEY `IDX_90632 072BC295696` (`image_attribute_id`)" occured an error : SQLSTATE[42S21]: Column already e xists: 1060 Duplicate column name 'image_attribute_id'

According this issue #92 I've reinstalled akeneo 2 severals times but get the same error.

Just a point, before any migration process, colum image_attribute_id exist into table pim_catalog_family belong to akeneo_pim 2.x database

Some idea?

Best regards

@paultvis
Copy link

I am having the same issue. I have tried multiple times and have reinstalled the database, but still get the same issue. Looking in the 1.7 instance, that column, image_attribute_id does exist. Also, in the php file, the migrate command is called before the column is added.

If I correct that issue (by commenting out the alter table step), a similar thing happens on the next step, but that can be corrected in the same way. However, the next error is more complicated (in batch tables from memory) and I couldn't see how to resolve that one.

Any suggestions? Has this been updated and would running an older version of transporteo be a solution?

Thanks,

Paul

@wbyrnetx
Copy link

I am also running into this issue trying to upgrade Akeneo from 1.x to 2.0.

It makes no sense to me why transporteo would try to add the "image_attribute_id" to the "pim_catalog_family" table on the destination Akeneo instance. That column has existing since version 2.0.0:
https://github.com/akeneo/pim-community-dev/blob/v2.0.0/src/Pim/Bundle/CatalogBundle/Resources/config/doctrine/Family.orm.yml

After commenting out the lines in src/Domain/MigrationStep/s080_FamilyMigration/FamilyDataMigrator.php that attempt to add the column, I continued getting DB schema related errors.

Am I missing something, or is this migration tool not compatible with a clean install of Akeneo 2.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants