/**
  * @inheritdoc
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     if ($schema instanceof ExtendSchema) {
         $queries->addQuery(new UpdateExtendConfigMigrationQuery($schema->getExtendOptions(), $this->commandExecutor, $this->configProcessorOptionsPath));
         $queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
     }
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $queries->addPreQuery(new ParametrizedSqlMigrationQuery('UPDATE orocrm_call SET created_at = :date, updated_at = :date', ['date' => new \DateTime('now', new \DateTimeZone('UTC'))], ['date' => Type::DATETIME]));
     $table = $schema->getTable('orocrm_call');
     $table->getColumn('created_at')->setOptions(['notnull' => true]);
     $table->getColumn('updated_at')->setOptions(['notnull' => true]);
 }
Exemplo n.º 3
0
 /**
  * @inheritdoc
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->modifyOrocrmSalesLeadTable($schema);
     $this->modifyOrocrmSalesOpportunityTable($schema);
     $this->modifyOrocrmSalesSalesFunnelTable($schema);
     $queries->addPostQuery(new MigrateAccountRelations());
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     self::addOrganizationDashboardTable($schema);
     self::dropOroDashboardActiveTableIndexes($schema);
     //Add organization fields to ownership entity config
     $queries->addQuery(new UpdateOwnershipTypeQuery('Oro\\Bundle\\DashboardBundle\\Entity\\Dashboard', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
 }
Exemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $queries->addQuery(new UpdateEntityConfigEntityValueQuery('Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowDefinition', 'entity', 'label', 'oro.workflow.workflowdefinition.entity_label'));
     $queries->addQuery(new UpdateEntityConfigEntityValueQuery('Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowDefinition', 'entity', 'plural_label', 'oro.workflow.workflowdefinition.entity_plural_label'));
     $queries->addQuery(new UpdateEntityConfigEntityValueQuery('Oro\\Bundle\\WorkflowBundle\\Entity\\ProcessDefinition', 'entity', 'label', 'oro.workflow.processdefinition.entity_label'));
     $queries->addQuery(new UpdateEntityConfigEntityValueQuery('Oro\\Bundle\\WorkflowBundle\\Entity\\ProcessDefinition', 'entity', 'plural_label', 'oro.workflow.processdefinition.entity_label'));
 }
Exemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->createAuditField($schema);
     $queries->addPostQuery(new MigrateAuditFieldQuery());
     $queries->addPostQuery('ALTER TABLE oro_audit DROP COLUMN data');
     $queries->addPostQuery($this->getDropEntityConfigFieldQuery('Oro\\Bundle\\DataAuditBundle\\Entity\\Audit', 'data'));
 }
Exemplo n.º 7
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     if ($schema->hasTable('oro_process_definition')) {
         $queries->addQuery(new ParametrizedSqlMigrationQuery('DELETE FROM oro_process_definition WHERE name = :name', ['name' => 'email_auto_response']));
         $queries->addQuery(new ParametrizedSqlMigrationQuery('DELETE FROM oro_process_trigger WHERE definition_name = :name', ['name' => 'email_auto_response']));
     }
 }
Exemplo n.º 8
0
 public function up(Schema $schema, QueryBag $queries)
 {
     $sqls = $this->container->get('test_service')->getQueries();
     foreach ($sqls as $sql) {
         $queries->addQuery($sql);
     }
 }
Exemplo n.º 9
0
 /**
  * @param Schema   $schema
  * @param QueryBag $queries
  * @param string   $tableName
  * @param string   $columnName
  * @param string   $type
  *
  * @throws \Exception
  */
 public function changePrimaryKeyType(Schema $schema, QueryBag $queries, $tableName, $columnName, $type)
 {
     $targetColumn = $schema->getTable($tableName)->getColumn($columnName);
     $type = Type::getType($type);
     if ($targetColumn->getType() === $type) {
         return;
     }
     /** @var ForeignKeyConstraint[] $foreignKeys */
     $foreignKeys = [];
     foreach ($schema->getTables() as $table) {
         /** @var ForeignKeyConstraint[] $tableForeignKeys */
         $tableForeignKeys = array_filter($table->getForeignKeys(), function (ForeignKeyConstraint $tableForeignKey) use($tableName, $columnName) {
             if ($tableForeignKey->getForeignTableName() !== $tableName) {
                 return false;
             }
             return $tableForeignKey->getForeignColumns() === [$columnName];
         });
         foreach ($tableForeignKeys as $tableForeignKey) {
             $foreignKeys[$tableForeignKey->getName()] = $tableForeignKey;
             $foreignKeyTableName = $tableForeignKey->getLocalTable()->getName();
             $foreignKeyColumnNames = $tableForeignKey->getLocalColumns();
             $queries->addPreQuery($this->platform->getDropForeignKeySQL($tableForeignKey, $foreignKeyTableName));
             $column = $schema->getTable($foreignKeyTableName)->getColumn(reset($foreignKeyColumnNames));
             if ($column instanceof ExtendColumn) {
                 $column->disableExtendOptions()->setType($type)->enableExtendOptions();
             } else {
                 $column->setType($type);
             }
         }
     }
     $targetColumn->setType($type);
     foreach ($foreignKeys as $foreignKey) {
         $queries->addPostQuery($this->platform->getCreateForeignKeySQL($foreignKey, $foreignKey->getLocalTable()));
     }
 }
Exemplo n.º 10
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     if (!$schema->hasTable('oro_process_trigger')) {
         return;
     }
     $queries->addQuery(new ParametrizedSqlMigrationQuery('DELETE FROM oro_process_trigger WHERE definition_name = :name', ['name' => 'convert_mailbox_email_to_case']));
 }
Exemplo n.º 11
0
 /**
  * Modify entity config to exclude currency and currency_precision fields
  *
  * @param Schema   $schema
  * @param QueryBag $queries
  */
 public static function updateConfigs(Schema $schema, QueryBag $queries)
 {
     $table = $schema->getTable('oro_organization');
     $table->dropColumn('currency');
     $table->dropColumn('currency_precision');
     if ($schema->hasTable('oro_entity_config_index_value') && $schema->hasTable('oro_entity_config_field')) {
         $queries->addPostQuery('DELETE FROM oro_entity_config_index_value
              WHERE entity_id IS NULL AND field_id IN(
                SELECT oecf.id FROM oro_entity_config_field AS oecf
                WHERE
                 (oecf.field_name = \'precision\' OR oecf.field_name = \'currency\')
                 AND
                 oecf.entity_id = (
                   SELECT oec.id
                   FROM oro_entity_config AS oec
                   WHERE oec.class_name = \'Oro\\\\Bundle\\\\OrganizationBundle\\\\Entity\\\\Organization\'
                 )
              );
              DELETE FROM oro_entity_config_field
                WHERE
                 field_name IN (\'precision\', \'currency\')
                 AND
                 entity_id IN (
                   SELECT id
                   FROM oro_entity_config
                   WHERE class_name = \'Oro\\\\Bundle\\\\OrganizationBundle\\\\Entity\\\\Organization\'
                 )');
     }
 }
Exemplo n.º 12
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     foreach ($this->getFieldsParamsForUpdate() as $field) {
         $queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
         $queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
     }
 }
Exemplo n.º 13
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     /** Update Email Origin Name */
     $queries->addPreQuery(new ParametrizedSqlMigrationQuery('UPDATE oro_email_origin SET name = :new_name WHERE name = :old_name', ['new_name' => 'useremailorigin', 'old_name' => 'imapemailorigin'], ['new_name' => Type::STRING, 'old_name' => Type::STRING]));
     /** Tables generation **/
     self::addSmtpFieldsToOroEmailOriginTable($schema);
 }
Exemplo n.º 14
0
 public function down(Schema $schema, QueryBag $queries)
 {
     $queries->addQuery("DROP TABLE c_notebook");
     $queries->addQuery("DROP TABLE c_notebook_audit");
     /*$this->addSql('CREATE TABLE oro_migrations (id INT AUTO_INCREMENT NOT NULL, bundle VARCHAR(250) NOT NULL, version VARCHAR(250) NOT NULL, loaded_at DATETIME NOT NULL, INDEX idx_oro_migrations (bundle), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
       $this->addSql('CREATE TABLE oro_migrations_data (id INT AUTO_INCREMENT NOT NULL, class_name VARCHAR(255) NOT NULL, loaded_at DATETIME NOT NULL, version VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
       $this->addSql('CREATE TABLE sylius_settings_parameter (id INT AUTO_INCREMENT NOT NULL, namespace VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:object)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
       $this->addSql('DROP TABLE c_item_visibility');
       $this->addSql('DROP TABLE c_item');
       $this->addSql('ALTER TABLE c_item_property DROP PRIMARY KEY');
       $this->addSql('ALTER TABLE c_item_property ADD iid INT AUTO_INCREMENT NOT NULL, ADD tool VARCHAR(100) NOT NULL, ADD visibility TINYINT(1) NOT NULL, ADD start_visible DATETIME DEFAULT NULL, ADD end_visible DATETIME DEFAULT NULL, CHANGE id id INT NOT NULL, CHANGE item_id ref INT NOT NULL');
       $this->addSql('CREATE INDEX idx_item_property_toolref ON c_item_property (tool, ref)');
       $this->addSql('CREATE INDEX idx_item_property_tooliuid ON c_item_property (tool, insert_user_id)');
       $this->addSql('ALTER TABLE c_item_property ADD PRIMARY KEY (iid)');
       $this->addSql('ALTER TABLE c_notebook DROP FOREIGN KEY FK_E7EE1CE0A76ED395');
       $this->addSql('ALTER TABLE c_notebook DROP FOREIGN KEY FK_E7EE1CE091D79BD3');
       $this->addSql('DROP INDEX IDX_E7EE1CE0A76ED395 ON c_notebook');
       $this->addSql('DROP INDEX IDX_E7EE1CE091D79BD3 ON c_notebook');
       $this->addSql('ALTER TABLE c_notebook DROP PRIMARY KEY');
       $this->addSql('ALTER TABLE c_notebook ADD notebook_id INT NOT NULL, ADD course VARCHAR(40) NOT NULL, CHANGE id iid INT AUTO_INCREMENT NOT NULL');
       $this->addSql('ALTER TABLE c_notebook ADD PRIMARY KEY (iid)');
       $this->addSql('ALTER TABLE c_notebook_audit DROP PRIMARY KEY');
       $this->addSql('ALTER TABLE c_notebook_audit ADD notebook_id INT DEFAULT NULL, ADD course VARCHAR(40) DEFAULT NULL, CHANGE id iid INT NOT NULL');
       $this->addSql('ALTER TABLE c_notebook_audit ADD PRIMARY KEY (iid, rev)');
       $this->addSql('ALTER TABLE media__media CHANGE content_type content_type VARCHAR(64) DEFAULT NULL');
       $this->addSql('ALTER TABLE media__media_audit CHANGE content_type content_type VARCHAR(64) DEFAULT NULL');
       $this->addSql('ALTER TABLE settings_current ADD namespace VARCHAR(255) NOT NULL, ADD name VARCHAR(255) NOT NULL');*/
 }
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->configManager->flushAllCaches();
     if ($schema instanceof ExtendSchema) {
         $queries->addQuery(new RefreshExtendConfigMigrationQuery($this->commandExecutor, $this->dataStorageExtension->get('initial_entity_config_state', []), $this->initialEntityConfigStatePath));
         $queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
     }
 }
Exemplo n.º 16
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     // fill empty updatedAt of orocrm_case_comment
     $queries->addPreQuery('UPDATE orocrm_case_comment SET updatedAt = createdAt WHERE updatedAt IS NULL');
     // make updatedAt NOT NULL
     $table = $schema->getTable('orocrm_case_comment');
     $table->changeColumn('updatedAt', ['notnull' => true]);
 }
Exemplo n.º 17
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $fields = [['entityName' => 'OroCRM\\Bundle\\ContactBundle\\Entity\\Contact', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.contact.created_at.label'], ['entityName' => 'OroCRM\\Bundle\\ContactBundle\\Entity\\Contact', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.contact.updated_at.label'], ['entityName' => 'OroCRM\\Bundle\\ContactBundle\\Entity\\ContactAddress', 'field' => 'created', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.contact.contactaddress.created.label'], ['entityName' => 'OroCRM\\Bundle\\ContactBundle\\Entity\\ContactAddress', 'field' => 'updated', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.contact.contactaddress.updated.label']];
     foreach ($fields as $field) {
         $queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
         $queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
     }
 }
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     if ($schema instanceof ExtendSchema) {
         $queries->addQuery(new UpdateExtendConfigMigrationQuery($schema->getExtendOptions(), $this->commandExecutor, $this->configProcessorOptionsPath));
         $queries->addQuery(new RefreshExtendConfigMigrationQuery($this->commandExecutor, $this->dataStorageExtension->get('initial_entity_config_state', []), $this->initialEntityConfigStatePath));
         $queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
     }
 }
Exemplo n.º 19
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $fields = [['entityName' => 'Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowDefinition', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'oro.workflow.workflowdefinition.created_at.label'], ['entityName' => 'Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowDefinition', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'oro.workflow.workflowdefinition.updated_at.label'], ['entityName' => 'Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowItem', 'field' => 'created', 'value' => 'oro.ui.created_at', 'replace' => 'oro.workflow.workflowitem.created.label'], ['entityName' => 'Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowItem', 'field' => 'updated', 'value' => 'oro.ui.updated_at', 'replace' => 'oro.workflow.workflowitem.updated.label']];
     foreach ($fields as $field) {
         $queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
         $queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
     }
 }
Exemplo n.º 20
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $schema->dropTable('oro_calendar_connection');
     $calendarConnectionClass = 'Oro\\Bundle\\CalendarBundle\\Entity\\CalendarConnection';
     $queries->addPostQuery(new ParametrizedSqlMigrationQuery('DELETE FROM oro_entity_config_field WHERE entity_id IN (' . 'SELECT id FROM oro_entity_config WHERE class_name = :class)', ['class' => $calendarConnectionClass], ['class' => 'string']));
     $queries->addPostQuery(new ParametrizedSqlMigrationQuery('DELETE FROM oro_entity_config WHERE class_name = :class', ['class' => $calendarConnectionClass], ['class' => 'string']));
     $queries->addPostQuery(new DeleteAclMigrationQuery($this->container, new ObjectIdentity('entity', $calendarConnectionClass)));
 }
 /**
  * @inheritdoc
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->configManager->clearCache();
     $this->configManager->clearConfigurableCache();
     if ($schema instanceof ExtendSchema) {
         $queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
     }
 }
Exemplo n.º 22
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $table = $schema->getTable('orocrm_marketing_list');
     $table->addColumn('organization_id', 'integer', ['notnull' => false]);
     $table->addIndex(['organization_id'], 'idx_3acc3ba32c8a3de', []);
     $table->addForeignKeyConstraint($schema->getTable('oro_organization'), ['organization_id'], ['id'], ['onUpdate' => null, 'onDelete' => 'SET NULL']);
     $queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\SalesBundle\\Entity\\Lead', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
 }
Exemplo n.º 23
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $fields = [['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\Lead', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.sales.lead.created_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\Lead', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.sales.lead.updated_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\Opportunity', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.sales.opportunity.created_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\Opportunity', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.sales.opportunity.updated_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\SalesFunnel', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.sales.salesfunnel.created_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\SalesFunnel', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.sales.salesfunnel.updated_at.label']];
     foreach ($fields as $field) {
         $queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
         $queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
     }
 }
Exemplo n.º 24
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     self::addOrganization($schema);
     //Add organization fields to ownership entity config
     $queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\ContactBundle\\Entity\\Contact', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
     //Add organization fields to ownership entity config
     $queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\ContactBundle\\Entity\\Group', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
 }
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $fields = [['entityName' => 'Oro\\Bundle\\EmbeddedFormBundle\\Entity\\EmbeddedForm', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'oro.embeddedform.created_at.label'], ['entityName' => 'Oro\\Bundle\\EmbeddedFormBundle\\Entity\\EmbeddedForm', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'oro.embeddedform.updated_at.label']];
     foreach ($fields as $field) {
         $queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
         $queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
     }
 }
Exemplo n.º 26
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     self::addOrganization($schema, 'orocrm_campaign');
     self::addOrganization($schema, 'orocrm_campaign_email');
     //Add organization fields to ownership entity config
     $queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\CampaignBundle\\Entity\\Campaign', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
     $queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\CampaignBundle\\Entity\\EmailCampaign', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
 }
Exemplo n.º 27
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $queries->addQuery(new DropUnusedEntityConfigFieldValuesQuery());
     $fields = [['entityName' => 'Oro\\Bundle\\OrganizationBundle\\Entity\\BusinessUnit', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'oro.organization.businessunit.created_at.label'], ['entityName' => 'Oro\\Bundle\\OrganizationBundle\\Entity\\BusinessUnit', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'oro.organization.businessunit.updated_at.label']];
     foreach ($fields as $field) {
         $queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
         $queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
     }
 }
Exemplo n.º 28
0
 /**
  * @inheritdoc
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     if ($schema->hasTable('oro_activity_list')) {
         $table = $schema->getTable('oro_activity_list');
         $table->addIndex(['related_activity_class'], 'tmp_al_related_activity_class');
         $table->addIndex(['related_activity_id'], 'tmp_al_related_activity_id');
         $queries->addQuery(new UpdateDateActivityListQuery());
     }
 }
Exemplo n.º 29
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $table = $schema->getTable('oro_segment_snapshot');
     $table->addColumn('integer_entity_id', 'integer', ['notnull' => false]);
     $table->changeColumn('entity_id', ['notnull' => false]);
     $table->addIndex(['integer_entity_id'], 'sgmnt_snpsht_int_entity_idx');
     $table->addIndex(['entity_id'], 'sgmnt_snpsht_str_entity_idx');
     $queries->addQuery(new UpdateSegmentSnapshotDataQuery());
 }
Exemplo n.º 30
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     self::addOrganization($schema);
     //Add organization fields to ownership entity config
     $queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\SalesBundle\\Entity\\Lead', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
     //Add organization fields to ownership entity config
     $queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\SalesBundle\\Entity\\Opportunity', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
     //Add organization fields to ownership entity config
     $queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\SalesBundle\\Entity\\B2bCustomer', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
 }