• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Migration\QueryBag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Oro\Bundle\MigrationBundle\Migration\QueryBag的典型用法代码示例。如果您正苦于以下问题:PHP QueryBag类的具体用法?PHP QueryBag怎么用?PHP QueryBag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了QueryBag类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: up

 /**
  * @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));
     }
 }
开发者ID:xamin123,项目名称:platform,代码行数:10,代码来源:UpdateExtendConfigMigration.php


示例2: up

 /**
  * {@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]);
 }
开发者ID:antrampa,项目名称:crm,代码行数:10,代码来源:OroCRMCallBundle.php


示例3: up

 /**
  * @inheritdoc
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->modifyOrocrmSalesLeadTable($schema);
     $this->modifyOrocrmSalesOpportunityTable($schema);
     $this->modifyOrocrmSalesSalesFunnelTable($schema);
     $queries->addPostQuery(new MigrateAccountRelations());
 }
开发者ID:antrampa,项目名称:crm,代码行数:10,代码来源:AddFields.php


示例4: up

 /**
  * {@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']));
 }
开发者ID:Maksold,项目名称:platform,代码行数:10,代码来源:OroDashboardBundle.php


示例5: up

 /**
  * {@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'));
 }
开发者ID:Maksold,项目名称:platform,代码行数:10,代码来源:UpdateEntityLabel.php


示例6: up

 /**
  * {@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'));
 }
开发者ID:nmallare,项目名称:platform,代码行数:10,代码来源:OroDataAuditBundle.php


示例7: up

 /**
  * {@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']));
     }
 }
开发者ID:Maksold,项目名称:platform,代码行数:10,代码来源:OroEmailBundle.php


示例8: up

 public function up(Schema $schema, QueryBag $queries)
 {
     $sqls = $this->container->get('test_service')->getQueries();
     foreach ($sqls as $sql) {
         $queries->addQuery($sql);
     }
 }
开发者ID:Maksold,项目名称:platform,代码行数:7,代码来源:Test2BundleMigration10.php


示例9: changePrimaryKeyType

 /**
  * @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()));
     }
 }
开发者ID:Maksold,项目名称:platform,代码行数:44,代码来源:ChangeTypeExtension.php


示例10: up

 /**
  * {@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']));
 }
开发者ID:antrampa,项目名称:crm,代码行数:10,代码来源:RemoveEmailConvertTrigger.php


示例11: updateConfigs

 /**
  * 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\'
                 )');
     }
 }
开发者ID:xamin123,项目名称:platform,代码行数:35,代码来源:OroOrganizationBundle.php


示例12: up

 /**
  * {@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']));
     }
 }
开发者ID:antrampa,项目名称:crm,代码行数:10,代码来源:UpdateCreatedUpdatedLabels.php


示例13: up

 /**
  * {@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);
 }
开发者ID:Maksold,项目名称:platform,代码行数:10,代码来源:OroImapBundle.php


示例14: down

 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');*/
 }
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:28,代码来源:NotebookBundle.php


示例15: up

 /**
  * {@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));
     }
 }
开发者ID:Maksold,项目名称:platform,代码行数:11,代码来源:RefreshExtendCacheMigration.php


示例16: up

 /**
  * {@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]);
 }
开发者ID:antrampa,项目名称:crm,代码行数:11,代码来源:OroCRMCaseBundle.php


示例17: up

 /**
  * {@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']));
     }
 }
开发者ID:antrampa,项目名称:crm,代码行数:11,代码来源:UpdateCreatedUpdatedLabels.php


示例18: up

 /**
  * {@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));
     }
 }
开发者ID:Maksold,项目名称:platform,代码行数:11,代码来源:UpdateExtendConfigMigration.php


示例19: up

 /**
  * {@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)));
 }
开发者ID:Maksold,项目名称:platform,代码行数:11,代码来源:RemoveCalendarConnection.php


示例20: up

 /**
  * @inheritdoc
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->configManager->clearCache();
     $this->configManager->clearConfigurableCache();
     if ($schema instanceof ExtendSchema) {
         $queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
     }
 }
开发者ID:xamin123,项目名称:platform,代码行数:11,代码来源:RefreshExtendCacheMigration.php



注:本文中的Oro\Bundle\MigrationBundle\Migration\QueryBag类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SecurityBundle\SecurityFacade类代码示例发布时间:2022-05-23
下一篇:
PHP Tools\ExtendHelper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap