Skip to main content
The doctrine section controls which Doctrine DBAL connection the bundle uses and how the menu tables are named.

Options

doctrine.connection
string
default:"default"
The Doctrine DBAL connection name. Set this when your menu tables live on a non-default database connection.
doctrine.table_prefix
string
default:"''"
Prefix prepended to all menu table names. An empty string means no prefix. With table_prefix: app_, the tables become app_dashboard_menu and app_dashboard_menu_item.
config/packages/nowo_dashboard_menu.yaml
nowo_dashboard_menu:
    doctrine:
        connection: default
        table_prefix: ''       # or e.g. 'app_'

Generating migrations

Use the bundle’s generate-migration console command instead of doctrine:schema:update whenever you use a custom connection or table prefix. The command reads your configured connection and prefix and generates a migration class accordingly.
php bin/console nowo_dashboard_menu:generate-migration

Command options

OptionDescription
--path=src/MigrationsDirectory where the migration file is written. Default: migrations/.
--namespace=App\MigrationsPHP namespace for the generated class. Default: DoctrineMigrations.
--dumpPrint the SQL to the console without writing a file. Useful when you do not use Doctrine Migrations.

Running migrations on a non-default connection

When your menu tables are on a connection other than default, pass --conn to the migrations command:
php bin/console doctrine:migrations:migrate --conn=YOUR_CONNECTION
Do not use doctrine:schema:update when you use a custom connection or table prefix. The generated migration targets the correct connection and uses the configured prefix; schema:update may target the wrong connection or produce incorrect table names.
The generated migration class extends Doctrine\Migrations\AbstractMigration. Your project must have doctrine/doctrine-migrations-bundle (or doctrine/migrations) installed to run it. If you do not use Doctrine Migrations, use --dump and execute the SQL manually.