archtechx / tenancy

Automatic multi-tenancy for Laravel. No code changes needed.
https://tenancyforlaravel.com
MIT License
3.68k stars 434 forks source link

PostgreSQL Tenant Database Not Automatically Created During Tenant Creation #1226

Closed naas1d513215 closed 6 months ago

naas1d513215 commented 6 months ago

Bug description

I'm using the latest version of the stancl/tenancy package (v3.x) with a Laravel application backed by a PostgreSQL database. According to the package documentation, upon creating a new tenant, a dedicated database should be automatically created for that tenant. However, I'm encountering an issue where this process seems to fail silently; no error is thrown, but the expected tenant-specific PostgreSQL database isn't being generated.template_tenant_connection has multiple schema。

Steps to reproduce

image

image

image

image

image

Expected behavior

a new PostgreSQL database named following the pattern defined in tenancy configuration (e.g., prefix_tenant_id_suffix) should exist

Laravel version

10.10

stancl/tenancy version

3.8