borsaco/doctrine-prefix-bundle
bor_users, sac_email). This aligns with multi-tenant, modular, or legacy migration architectures where table/column naming conventions must be enforced.NamingStrategy interface, ensuring compatibility with existing ORM configurations. The ability to chain with UnderscoreNamingStrategy (or others) adds flexibility for teams using custom naming conventions.Platform or SchemaTool wrappers).NamingStrategy interface changes in newer Doctrine versions.DependencyInjection).ALTER TABLE).bor_users → bor_user_roles).PrefixNamingStrategy + UnderscoreNamingStrategy).dev_, prod_)? How is this configured?StofDoctrineExtensions) or custom Platform classes achieve the same goal with lower risk?beberlei/DoctrineExtensions) to integrate the bundle via a custom NamingStrategy.Container calls to Laravel’s ServiceProvider.Schema::defaultStringLength + custom create methods) if Doctrine isn’t mandatory.doctrine_prefix.yaml with prefixes and base strategy (e.g., UnderscoreNamingStrategy).doctrine_prefix:
table_prefix: app_
column_prefix: user_
naming_strategy:
class: Doctrine\ORM\Mapping\UnderscoreNamingStrategy
// Example migration snippet
$this->renameTable('users', 'app_users');
$this->renameColumn('users', 'email', 'user_email');
PrefixNamingStrategy (e.g., @Table(name="app_users")).creating, created) to modify table/column names.doctrine_prefix.yaml.dist).PrefixNamingStrategy and other strategies (e.g., UnderscoreNamingStrategy).tenant1_users, tenant2_users).tenant1_user_roles → tenant1_users).SHOW INDEX).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Bundle compatibility break | Schema generation fails | Fork/patch or switch to alternative |
| Manual prefix mismatches | Foreign key constraints violated | CI checks for naming consistency |
| Migration script errors | Data corruption | Backup + rollback testing |
| Raw SQL bypassing prefixes | Inconsistent schema usage | Enforce Doctrine for all DB operations |
| Doctrine version incompatibility | Runtime exceptions | Test with target Doctrine version early |
How can I help you explore Laravel packages today?