ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 2 replies, has 2 voices, and was last updated by golriz.nourani golriz.nourani 1 year, 9 months ago.

  • Creator
    Topic
  • #11234
    golriz.nourani
    golriz.nourani
    Participant

    Dear Sir
    I create a migration for orocrm_task table and when I run migarion:load , orocrm_task will be changed but if I run schema:update , all changes on orocrm_tasl will be lost .
    could you help me?
    regards,

    my migration code in below :

    class TestBundle implements Migration, ExtendExtensionAwareInterface
    {

    /**
    * @var ExtendExtension $extendExtension
    */
    protected $extendExtension;

    /**
    * Modifies the given schema to apply necessary changes of a database
    * The given query bag can be used to apply additional SQL queries before and after schema changes
    *
    * @param Schema $schema
    * @param QueryBag $queries
    * @return void
    */
    public function up(Schema $schema, QueryBag $queries)
    {
    $task = $schema->getTable(‘orocrm_task’);
    $activity_list= $schema->getTable(‘oro_activity_list’);
    $task ->addColumn(‘column1’, ‘string’, [‘notnull’ => true]);
    $this->extendExtension->addManyToOneRelation($schema,
    $task, ‘related_activity’,
    $activity_list, ‘id’);

    }

    /**
    * Sets the ExtendExtension
    *
    * @param ExtendExtension $extendExtension
    */
    public function setExtendExtension(ExtendExtension $extendExtension)
    {
    $this->extendExtension = $extendExtension;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #11266
    Dima Soroka
    Dima Soroka
    Oro Core

    Please make sure your Task entity definition is correct, seems like your entities definition doesn’t match schema.

    #12709
    golriz.nourani
    golriz.nourani
    Participant

    thanks for answer
    I update my orocrm version. it is resolved.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.