This topic contains 2 replies, has 2 voices, and was last updated by golriz.nourani 8 years, 8 months ago.
- Topic
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;
}
The forum ‘OroPlatform – Installation/Technical Issues or Problems’ is closed to new topics and replies.