roukmoute / doctrine-prefix-bundle
Listener that prefixes tables and sequences
Installs: 19 362
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- doctrine/event-manager: ^1.1
- doctrine/orm: ^2.7
- symfony/config: 3.4.*|4.4.*
- symfony/dependency-injection: 3.4.*|4.4.*
- symfony/http-kernel: 3.4.*|4.4.*
This package is auto-updated.
Last update: 2025-02-27 13:52:22 UTC
README
DoctrinePrefixBundle
This bundle prefixes tables and, if you are using PostgreSQL, sequences with a
string of your choice by changing the metadata of your entities. Prefixes are
good if you need to share a database with tables from another project, or if
you want to name your entities using reserved keywords like user
or group
.
Installation
composer require roukmoute/doctrine-prefix-bundle
Configuration
First, you need to register the bundle in your application kernel, like this :
<?php //app/AppKernel.php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), … new Roukmoute\DoctrinePrefixBundle\RoukmouteDoctrinePrefixBundle() ); …
The configuration looks as follows :
roukmoute_doctrine_prefix: # will be prepended to table and sequence names prefix: sf # if set, the prefix will be applied to specified bundles only bundles: [] # the encoding to convert the prefix to encoding: UTF-8