Open fmiqbal opened 4 years ago
Sorry for my lack of patience on submitting issue, After I reread the configuration,
/**
* The tenant migrations to be run during creation of a tenant. Specify a directory
* to run the migrations from. If specified these migrations will be executed
* whenever a new tenant is created.
*
* @info set to false to disable auto migrating.
*
* @warn this has to be an absolute path, feel free to use helper methods like
* base_path() or database_path() to set this up.
*/
'tenant-migrations-path' => database_path('migrations/tenant'),
so this is an expected behaviour ? I still stand my opinion that migration should run when database is created, not when website is created. For now I think I have my lead for my problem.
I'm not sure why this was closed so quickly, and without response from one of the maintainers.
While it is expected behavior, that doesn't make it correct. I'm not opposed to changing that event association as suggested, so long as it's adequately tested and the ramifications of doing so are properly considered.
@ArlonAntonius / @bkintanar, any thoughts on this? concerns?
Description
I try to disable
auto-create-tenant-database
so i could create it later manually (and as a part of my testing), but when I try to seed it, it gave meUnknown database
error.Actual behavior
The
Hyn\Tenancy\Listeners\Database\MigratesTenants
is subscribing toEvents\Websites\Created
Expected behavior
Because I didnt create the database, it also shouldn't try to migrate. MigratesTenants should subsribe to
Events\Database\Created
Information
tenancy.php config
webserver.php config
Error log
maybe relevant information, the database prefix tenant I is from ConfigurationLoaded Listener I create,
the
CreateWebsite
Listener is listening toInstitutionCreate
Event (Instituion
being the model object bind to website, user can have many institution)