Closed Ohabiballah closed 4 years ago
I did a lot of tests, the problem is when I use a uuid for the first time it's work fine so when i delete this tenant and use the same uuid for the second time it's show this problem.
When you delete the database do you remember to delete the associated user too?
If you don't and use the same uuid probably the user remains created with the old password and you can't access to the new database.
If I remember correctly there is a create user if not exists
query during the database creation that will not throw an error if a user with the same name is found.
IMO an error should be thrown to identify such kind of problems.
@Bibendus83 is most likely correct. When you delete a tenant, make sure you use the WebsiteRepository as it will fire the necessary events to cleanup the extras such as the database user.
Every things works fine but when i add a specific $website->uuid it's give me this error :
SQLSTATE[HY000] [1045] Access denied for user 'rmaroc.heyme-intermediation.local'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = rmaroc.heyme-intermediation.local and table_name = migrations and table_type = 'BASE TABLE')
the rmaroc.heyme-intermediation.local is the custom uuid that i set.
this is my tenancy config file : `
use Hyn\Tenancy\Database\Connection;
// eg an admin seeder under
app/Seeders/AdminSeeder.php
: // 'tenant-seed-class' => App\Seeders\AdminSeeder::class,// App\User::class ], 'force-system-connection-of-models' => [ // App\User::class ], ],
]; ` this is the first time i use tenancy please can you help me .