OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

This topic contains 2 replies, has 2 voices, and was last updated by  golriz.nourani 8 years, 8 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #35194

    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
  • #35195

    Dima Soroka
    Keymaster

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

    #35196

    golriz.nourani
    Participant

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

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

The forum ‘OroPlatform – Installation/Technical Issues or Problems’ is closed to new topics and replies.

Back to top