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!
-
- Posts: 7
- Joined: 16 Apr 2017, 00:35
Need to change the database schema
I use Aimeos 2017.04 with PostgreSQL 9.6.2 and Laravel 5.4 with PHP 7.1.1. I use Windows 8 Pro. I want to ask, if I change the PostgreSQL database schema(including the tables) in the demo app, can the source code still work? Or i have to change the source code to adapt to new schema? Thank you.
Re: Need to change the database schema
Depends which schema changes you want to make. Can you explain a bit in more detail?
The correct way is explained in the Aimeos Wiki: https://aimeos.org/docs/Developers/Library/Setup_tasks
The correct way is explained in the Aimeos Wiki: https://aimeos.org/docs/Developers/Library/Setup_tasks
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 7
- Joined: 16 Apr 2017, 00:35
Re: Need to change the database schema
I want to replace entire demo schema with my own designed schema. My own designed schema is different with the demo schema. My schema has foreign keys and has a lot more tables and columns. What do i need to do to replace the demo schema with my own designed schema? Do i need to change the code in the application too? Thank you.
Re: Need to change the database schema
Can you please post an example of what you want to change?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 7
- Joined: 16 Apr 2017, 00:35
Re: Need to change the database schema
I want to change mshop_order table into order table which consists of :
- ID
Buyer_ID
Payment_Method_Type_ID
Buyer_Address
Timestamp
Re: Need to change the database schema
You can extend the mshop_order table but you should keep the existing data as well. Otherwise, there's no place to store important information and you will get trouble with e.g. the confirmation e-mails.
For changing the table schema, have a look at this article:
https://aimeos.org/docs/Developers/Libr ... ema_update
This one explains how to extend the order item and manager to store the additional data:
https://aimeos.org/docs/Developers/Libr ... gers_items
For changing the table schema, have a look at this article:
https://aimeos.org/docs/Developers/Libr ... ema_update
This one explains how to extend the order item and manager to store the additional data:
https://aimeos.org/docs/Developers/Libr ... gers_items
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Need to change the database schema
Hello,
What is the proper way to override this file?
vendor/aimeos/aimeos-core/setup/default/schema/review.php
I have attempted to override it in my extension, it didn't work:
/packages/<my-extension>/database/setup/default/schema/review.php
What is the proper way to override this file?
vendor/aimeos/aimeos-core/setup/default/schema/review.php
I have attempted to override it in my extension, it didn't work:
/packages/<my-extension>/database/setup/default/schema/review.php
Re: Need to change the database schema
The correct directory is:
Code: Select all
/packages/<my-extension>/setup/default/schema/review.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Need to change the database schema
Hello,
That did not work.
When executing php artisan aimeos:setup, it stops on Migrating: vendor/aimeos/aimeos-core/setup/Review.php
Error:
I understand that is because there are existing reviews from the same user in the database, but that is the purpose of modifying the database, to allow adding multiple reviews by the same person and not breaking the setup command.
That did not work.
When executing php artisan aimeos:setup, it stops on Migrating: vendor/aimeos/aimeos-core/setup/Review.php
Error:
Code: Select all
Doctrine\DBAL\Exception\UniqueConstraintViolationException
An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-product-<product id>-1.' for key 'unq_msrev_cid_dom_rid_sid'
Re: Need to change the database schema
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.
Each customer can add only one review for each product and this is ensured by the constraint.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
