ullCms - add a custom column/field

Modify the model

  • Add the desired columns in config/doctrine/schema.yml
    • #Custom cms columns     
      UllCmsPage:
        columns:
          gallery:
            type: string(4000)
      

Generate migration

  • php symfony doctrine:generate-migration add_ull_cms_gallery
  • The new migration is created in  lib/migration/doctrine/
  • Move the file to lib/migration/custom
  • The empty migration file looks like this
    • <?php
      
      class AddUllCmsGallery extends Doctrine_Migration_Base
      {
        public function up()
        {
        }
      
        public function down()
        {
        }
      }
  • Add your column(s) to the up() method:
    • <?php
      
      class AddUllCmsGallery extends Doctrine_Migration_Base
      {
        public function up()
        {
          $this->addColumn('ull_cms_item', 'gallery', 'string', 4000);
        }
      
        public function down()
        {
        }
      }

Refresh your project and database

  • batch/refresh_completely