Skip over navigation
Documentation
You are currently viewing documentation for version 3.0 which is not a long-term support release. The latest long-term support release is version 1.6

How to Generate an Installer for a Bundle

When you have implemented new entities, you want to be sure that upon installing the application, the entities are added to the database. For this, you need to create an installer. You can do it manually, however, it is more convenient to use a dump of the database as a template.

To create an installer for AcmeBundle:

  1. Clear the application cache:

    1
    bin/console cache:clear
    
  2. Apply the changes that you defined in your code to the database:

    1
    bin/console doctrine:schema:update
    
  3. Generate an installer and save it to the AcmeBundleInstaller.php:

    1
    bin/console oro:migration:dump --bundle=AcmeBundle > AcmeBundleInstaller.php
    

    Hint

    The generated installer may contain a lot of excessive information as the same database table might contain options related to different bundles and entities while the generator has no option to distinguish which entity ‘has added’ particular options. Delete the information unrelated to your entities from the output file.

Move AcmeBundleInstall.php to the AcmeBundle/Migrations/Schema directory.
  1. Reinstall your application instance.

  2. Check that the database is synced with your code:

    1
    bin/console doctrine:schema:update --dump-sql
    

    If the database is successfully synchronized, you will see the following message:

    1
    Nothing to update - your database is already in sync with the current entity metadata.
    
Browse maintained versions:3.01.6

You will be redirected to [title]. Would you like to continue?

Yes No
sso for www.magecore.comsso for oroinc.desso for oroinc.fr
Back to top