Need to change the database schema
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Need to change the database schema
Hello,aimeos wrote: 07 Apr 2023, 08:36 The problem might be that the demo data isn't removed before importing it again and therefore, the exact same row causes the problem now.
Each customer can add only one review for each product and this is ensured by the constraint.
I thought that you need to add more parameters to php artisan aimeos:setup for it to install the demo data.
I don't want to install the demo data, just run database migrations, this is also required if I make changes to the ElasticSearch config, like max_result_window. php artisan aimeos:setup updates the ElasticSearch index config.
I want customers to be able to add multiple reviews to the same product and not have to remove that database change when it's required to execute the php artisan aimeos:setup command.
Is here no way to override vendor/aimeos/aimeos-core/setup/default/schema/review.php so that php artisan aimeos:setup reads from the overriden file itself?
So far the only thing I've come up with is changing the original file:
vendor/aimeos/aimeos-core/setup/default/schema/review.php
This works, but if there is an update, the changes to this file will be removed, and I will get "Integrity constraint violation" again, and I will have to modify the original file again, which I want to avoid and override it instead.
Re: Need to change the database schema
You can add a setup/default/schema/review.php file in your own Aimeos extension and there, you can remove the unique index:
https://github.com/aimeos/aimeos-core/b ... ew.php#L28
This should be done before the table migration is executed.
https://github.com/aimeos/aimeos-core/b ... ew.php#L28
Code: Select all
$this->dropIndex( 'mshop_review', 'unq_msrev_cid_dom_rid_sid' );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,