Users Table: Changing Table 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!
Users Table: Changing Table Schema
Laravel: 5.6
Aimeos: 2018.07
PHP: 7.1.18
Hi,
I want to change unique index on email field in users table. So, I created a Schema file inside my extension. The name of the file is "customer.php" and it has the following lines of code:
So, when I execute command. I get following error:
Thanks!
Aimeos: 2018.07
PHP: 7.1.18
Hi,
I want to change unique index on email field in users table. So, I created a Schema file inside my extension. The name of the file is "customer.php" and it has the following lines of code:
Code: Select all
<?php
return array(
'table' => array(
'users' => function (\Doctrine\DBAL\Schema\Schema $schema) {
$table = $schema->getTable('users');
$table->dropIndex('unq_lvusr_email');
return $schema;
}
)
);
Code: Select all
php artisan aimeos:setup
So, what is going here? I have been doing the same thing for other tables.In SchemaException.php line 46:
There is no table with name 'public.users' in the schema.
Thanks!
Re: Users Table: Changing Table Schema
The "users" table is a Laravel not managed by Aimeos. You have to use Laravel migrations to change the table but we would strongly recommend to keep the unique index on the email column!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Users Table: Changing Table Schema
Hey, thanks for the help! Laravel migration file doesn't have all the fields for `users` table that I see in `users` table but Aimeos schema file have those fields. So, I thought that the migration is running from there.aimeos wrote:The "users" table is a Laravel not managed by Aimeos. You have to use Laravel migrations to change the table but we would strongly recommend to keep the unique index on the email column!
Anyhow, thanks!
Re: Users Table: Changing Table Schema
You are also right but it's not managed by the Aimeos Core and by the ai-laravel extension instead. Your own extension has to depend on 'ai-laravel' in the manifest.php of your extension so it's definition is available when you try to access it.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Users Table: Changing Table Schema
Hi,aimeos wrote:You are also right but it's not managed by the Aimeos Core and by the ai-laravel extension instead. Your own extension has to depend on 'ai-laravel' in the manifest.php of your extension so it's definition is available when you try to access it.
Thanks again for your help! Each time I learn something new.
Thanks!