setup task

Help for integrating the Laravel package
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!
yong
Posts: 43
Joined: 10 Apr 2019, 12:55

setup task

Post by yong » 12 Jul 2019, 14:02

please i 'm trying to understand the structure of the setup task ; i want first to know where is the setup task which added columns (label, salutations, company etc.) in the " users " table of laravel !
I looked at aimeos-core/lib/mshoplib/setup but i didn't see any class that do it !

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: setup task

Post by aimeos » 14 Jul 2019, 11:03

The aimeos/ai-laravel extension contains all Laravel related integration code, e.g. the database setup:
https://github.com/aimeos/ai-laravel/bl ... stomer.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

yong
Posts: 43
Joined: 10 Apr 2019, 12:55

Re: setup task

Post by yong » 16 Jul 2019, 13:27

thanks ! but i want to know how to apply those customer setup in the real database ! which commands allow us to apply the database changes and i don't completly understand the basics setup tasks in the laravel documentation ! Need help please ...!

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: setup task

Post by aimeos » 16 Jul 2019, 14:53

The setup tasks are executed if you run:

Code: Select all

php artisan aimeos:setup
You mean the documentation about adapting the database setup?
https://aimeos.org/docs/Developers#Database
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star


yong
Posts: 43
Joined: 10 Apr 2019, 12:55

Re: setup task

Post by yong » 17 Jul 2019, 08:45

please have u another documentations or explanations for setup task process ! I don't understand setup task class works and how to include ur own schema file in that class

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: setup task

Post by aimeos » 17 Jul 2019, 08:46

What to you want to achieve? Extend an existing table, create a new one? Explain best by your example.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

yong
Posts: 43
Joined: 10 Apr 2019, 12:55

Re: setup task

Post by yong » 17 Jul 2019, 09:02

I want to extend an existing table (table user of laravel) and create new tables for an existing domain (customer, product ) and join the tables of a different domain with foreign constraint !

yong
Posts: 43
Joined: 10 Apr 2019, 12:55

Re: setup task

Post by yong » 17 Jul 2019, 09:57

Need helps please ...

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: setup task

Post by aimeos » 17 Jul 2019, 10:13

To extend the Laravel "users" table, simply add a ./lib/custom/setup/default/schema/customer.php that contains your additional columns similar to the original file: https://github.com/aimeos/ai-laravel/bl ... stomer.php

https://aimeos.org/docs/Developers/Libr ... ing_tables:

Code: Select all

return array(
	'table' => array(
		'users' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
			$table = $schema->getTable( 'users' );
			$table->addColumn( 'mycol', 'integer' );
			return $schema;
		}
	),
);
There you can also create new tables. For new product tables create a file named product.php with the same structure:
https://aimeos.org/docs/Developers/Libr ... new_tables

Code: Select all

return array(
	'table' => array(
		'mshop_product_mytable' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
			$table = $schema->createTable( 'mshop_product_mytable' );
			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
			return $schema;
		}
	),
);
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply