DDC-153: add a database table prefix option #190

Open
opened 2026-01-22 12:30:03 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 16, 2009).

Jira issue originally created by user itoijala:

A nice option would be the ability to set a prefix for database table names.

Example:

entity table name (@Table) = users

prefix = foo_

=> table name in database = foo . name = foo_users

The option should default to an empty string.

This would make it possible to run multiple instances of the same application in a single database and remove naming conflicts between apps (many apps will want tot use the table users, for example). Each application could be configured to use a custom prefix. Without this feature, changes in the code in many places would be required, making updating the app difficult. This would be especially useful in a shared hosting environment where every user only has one database.

Originally created by @doctrinebot on GitHub (Nov 16, 2009). Jira issue originally created by user itoijala: A nice option would be the ability to set a prefix for database table names. Example: entity table name (@Table) = users prefix = foo_ => table name in database = foo . name = foo_users The option should default to an empty string. This would make it possible to run multiple instances of the same application in a single database and remove naming conflicts between apps (many apps will want tot use the table users, for example). Each application could be configured to use a custom prefix. Without this feature, changes in the code in many places would be required, making updating the app difficult. This would be especially useful in a shared hosting environment where every user only has one database.
admin added the New Feature label 2026-01-22 12:30:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#190