Laravel user schema update

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!
Justus
Posts: 13
Joined: 02 Aug 2022, 19:19

Laravel user schema update

Post by Justus » 11 Jan 2023, 18:54

I'm trying to modify the user schema and change the existing column
but when I run the command "php artisan aimeos:setup" I get the message:

Code: Select all

 Using schema from customer.php
There is no table with name 'users' in the schema
Has anyone had the same issue or can suggest what's wrong?

Here is my file

Code: Select all

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

            $table = $schema->getTable('users');

            $table->changeColumn('name', ['length' => 255, 'default' => '']);
            
            return $schema;
        },
    ],
];
Similar works for other tables but not for "users"

I have aimeos/aimeos-laravel 2021.10.6

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

Re: Laravel user schema update

Post by aimeos » 12 Jan 2023, 09:57

Guess, the users table is available, isn't it?
Do you have different databases for all users* tables and the rest?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Justus
Posts: 13
Joined: 02 Aug 2022, 19:19

Re: Laravel user schema update

Post by Justus » 12 Jan 2023, 10:08

users table is present and the changes work from aimeos/ai-laravel, but when I created the same customer.php file in my extension and want to change some columns, when I run the setup command, I get this result

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

Re: Laravel user schema update

Post by aimeos » 12 Jan 2023, 10:10

Add "ai-laravel" into the "depends" section of the manifest.php in your own extension to get the dependencies right.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Justus
Posts: 13
Joined: 02 Aug 2022, 19:19

Re: Laravel user schema update

Post by Justus » 12 Jan 2023, 10:21

thanks a lot, it seems the list of dependencies was generated automatically and I completely forgot about it :roll:

Post Reply