Hello,
we are trying to update SW6 setup and have this error:
Error
Received the following error message:
An exception occurred while executing ' CREATE TABLE `acl_role` ( `id` BINARY(16) NOT NULL, `name` VARCHAR(255) NOT NULL, `created_at` DATETIME(3) NOT NULL, `updated_at` DATETIME(3) NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ': SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'acl_role' already exists
Please try to fix this error and restart the update.
Response
{"valid":false,"errorMsg":"An exception occurred while executing '\n CREATE TABLE `acl_role` (\n `id` BINARY(16) NOT NULL,\n `name` VARCHAR(255) NOT NULL,\n `created_at` DATETIME(3) NOT NULL,\n `updated_at` DATETIME(3) NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci\n ':\n\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'acl_role' already exists"}
Anyone has such experience?
‚acl_role‘ already exists
Maybe you did that update twice? The table has to be removed from the database. Also removing the „dummy“ (i think its located in files/update) file when retry the update.
Maybe you did that update twice?
Thank you for a reply Brettvormkopp!
- Update failed the 1st time and the 2nd, so I did update 0 times. But there were 2 attempts.
- Now I need to dig deeper in Shopware SQL structure i guess, because I can’t just delete the table. When I drop it, i got this warning:
SQL query:
DROP TABLE acl_role
MySQL said:
#1451 - Cannot delete or update a parent row: a foreign key constraint fails
- Then, when I try to use ON DELETE CASCADE action, i got this:
SQL query:
SELECT TABLE_NAME FROM referential_constraints WHERE CONSTRAINT_SCHEMA = ‚c2064test‘ AND referenced_table_name = ‚acl_role‘ AND delete_rule = ‚CASCADE‘ LIMIT 0, 25
MySQL said:
#1146 - Table ‚c2064db_maksyna_new.referential_constraints‘ doesn’t exist
Can someone drop a tip for the Shopware database workaround?
Have a lovely weekend!
If someone have same issue - removing database fields helped to migrate finally.
What do you mean with „removing database fields“?