Create new mshop table ?

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!
MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Create new mshop table ?

Post by MikaelNazarenko » 16 Mar 2020, 12:55

Versions of components:

Code: Select all

aimeos/ai-admin-jqadm                 2019.10.6  Aimeos ai-admin-jqadm extension
aimeos/ai-admin-jsonadm               2019.10.2  Aimeos ai-admin-jsonadm extension
aimeos/ai-client-html                 2019.10.10 Aimeos ai-client-html extension
aimeos/ai-client-jsonapi              2019.10.2  Aimeos JSON API extension
aimeos/ai-controller-frontend         2019.10.3  Aimeos ai-controller-frontend extension
aimeos/ai-controller-jobs             2019.10.4  Aimeos ai-controller-jobs extension
aimeos/ai-gettext                     2019.10.1  Aimeos Gettext extension
aimeos/ai-laravel                     2019.10.2  Laravel adapter for Aimeos web shops and e-commerce solutions
aimeos/ai-payments                    2019.10.1  Payment extension for Aimeos web shops and e-commerce solutions
aimeos/ai-swiftmailer                 2019.10.1  SwiftMailer adapter for Aimeos web shops and e-commerce solutions
aimeos/aimeos-core                    2019.10.7  Full-featured e-commerce components for high performance online shops
aimeos/aimeos-laravel                 2019.10.1  Professional, full-featured and high performance Laravel e-commerce package for online shops and complex B2B projects

How to create new mshop table ?

I have added file /var/www/schmuck/ext/custom/lib/custom/setup/default/schema/page.php:

Code: Select all

return [

    'table' => [
        'mshop_page' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {

            $table = $schema->createTable( 'mshop_page' );

            $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
            $table->addColumn( 'siteid', 'integer', [] );
            $table->addColumn( 'type', 'string', array( 'length' => 64 ) );
            $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
            $table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
            $table->addColumn( 'label', 'string', array( 'length' => 255 ) );
            $table->addColumn( 'content', 'text', array( 'length' => 0xffffff ) );
            $table->addColumn( 'status', 'smallint', [] );
            $table->addColumn( 'mtime', 'datetime', [] );
            $table->addColumn( 'ctime', 'datetime', [] );
            $table->addColumn( 'editor', 'string', array('length' => 255 ) );

            $table->setPrimaryKey( array( 'id' ), 'pk_mspag_id' );
            $table->addIndex( array( 'siteid', 'domain', 'status' ), 'idx_mspag_sid_domain_status' );
            $table->addIndex( array( 'siteid', 'domain', 'langid' ), 'idx_mspag_sid_domain_langid' );
            $table->addIndex( array( 'siteid', 'domain', 'label' ), 'idx_mspag_sid_dom_label' );

            return $schema;
        },
    ]

];
But when I execute command

Code: Select all

php artisan aimeos:setup
seems that migration even is not executed...

MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Re: Create new mshop table ?

Post by MikaelNazarenko » 16 Mar 2020, 15:42

I only found solution to add pages creation code to /var/www/schmuck/ext/labor/lib/custom/setup/default/schema/customer.php file, because I also have extended customer.

Then page table is created.. But doesn't look clear..

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

Re: Create new mshop table ?

Post by aimeos » 17 Mar 2020, 08:28

The setup files are used by this setup task:
https://github.com/aimeos/aimeos-core/b ... eMShop.php

You should create your own setup task that extends from this task and overwrites the migrate() method.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply