Page 1 of 1

All shop related tables in own database except users table

Posted: 10 Nov 2017, 11:29
by schoelli
I have installed Aimeos 2017.10 in my existing Laravel 5.4 project. I want to have all shop tables in an "aimeos" database, just the users table should be taken from my existing Laravel project. How can I setup this configuration?

Re: All shop related tables in own database except users tab

Posted: 10 Nov 2017, 11:51
by aimeos
Here's the documentation: https://aimeos.org/docs/Laravel/Several_databases

Configure the "db" resource to point to your Aimeos database and the "db-customer" resource to your main database. There will be three tables that are related to the users table (users_address, users_list and users_list_type) which have to stay together with the users table because of the foreign key constraints.

Re: All shop related tables in own database except users tab

Posted: 14 Nov 2017, 11:51
by schoelli
Okay, thanks! How can I migrate the existing shop to the new configuration? Simply rerun php artisan aimeos:setup? Or do I have to copy some tables from the aimeos database to the Laravel project database? Or do I have to setup the shop from scratch?

And are the mshop_customer_* tables also part in the db-customer resource?

Re: All shop related tables in own database except users tab

Posted: 14 Nov 2017, 20:57
by aimeos
After configuring the databases, you can simply run "./artisan aimeos:setup" to create the tables in the new database. If you already added products, you can export and import the table content.

Yes, the mshop_customer* tables belong to the db-customer resource. But they are not used because in Laravel, only the users* tables are used

Re: All shop related tables in own database except users tab

Posted: 16 Nov 2017, 15:23
by schoelli
Thanks, setting up the db-customer configuration and ./artisan aimeos:setup worked. It also keeps my existing product tables untouched.

One thing I noticed is that the mshop_customer* tables are also created in my project database. When I deleted the mshop_customer_group table, aimeos crashed. So there is still a dependency on this table.

An issue I have is that the aimeos admin inferface for editing a customer overwrites the users.name column with the email address of the user. Can I change this behavior?

Re: All shop related tables in own database except users tab

Posted: 16 Nov 2017, 21:14
by aimeos
schoelli wrote: One thing I noticed is that the mshop_customer* tables are also created in my project database. When I deleted the mshop_customer_group table, aimeos crashed. So there is still a dependency on this table.
The mshop_customer_group table is still necessary because it contains the user groups for the Aimeos permission system. It would not make sense to create a users_group table which is only a duplicate of mshop_customers_group.
schoelli wrote: An issue I have is that the aimeos admin inferface for editing a customer overwrites the users.name column with the email address of the user. Can I change this behavior?
You can overwrite the saveItem() method of the customer manager and use a different SQL statement:
- https://github.com/aimeos/ai-laravel/bl ... l.php#L297
- https://github.com/aimeos/ai-laravel/bl ... r.php#L275