当前位置: 首页>>代码示例>>PHP>>正文


PHP AbstractSchemaManager::dropTable方法代码示例

本文整理汇总了PHP中Doctrine\DBAL\Schema\AbstractSchemaManager::dropTable方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractSchemaManager::dropTable方法的具体用法?PHP AbstractSchemaManager::dropTable怎么用?PHP AbstractSchemaManager::dropTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\DBAL\Schema\AbstractSchemaManager的用法示例。


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

示例1: deleteModel

 /**
  * Drop database represented by the model.
  *
  * @param Model $model
  *
  * @since 1.1.0
  *
  * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
  */
 public function deleteModel($model)
 {
     // first remove any automatically created models
     /** @var $relationField ManyToManyField */
     foreach ($model->meta->localManyToMany as $name => $relationField) {
         if ($relationField->relation->through->meta->autoCreated) {
             $this->deleteModel($relationField->relation->through);
         }
     }
     $this->schemaManager->dropTable($model->meta->dbTable);
 }
开发者ID:eddmash,项目名称:powerorm,代码行数:20,代码来源:SchemaEditor.php

示例2: createTable

 /**
  * @param AbstractSchemaManager $schemaM
  * @param Schema                $schema
  *
  * @since 1.1.0
  *
  * @author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
  */
 public function createTable($schemaM, $schema)
 {
     if ($schemaM->tablesExist('artists')) {
         $schemaM->dropTable('artists');
     }
     if ($schemaM->tablesExist('user')) {
         $schemaM->dropTable('user');
     }
     echo 'Tables :: ';
     $UTable = $schema->createTable('user');
     $UTable->addColumn('id', 'integer', ['unsigned' => true, 'autoincrement' => true]);
     $UTable->addColumn('name', 'string', ['length' => 60]);
     $UTable->setPrimaryKey(['id']);
     $myTable = $schema->createTable('artists');
     $myTable->addColumn('id', 'integer', ['unsigned' => true, 'autoincrement' => true]);
     $myTable->addColumn('user_id', 'integer', ['unsigned' => true]);
     $myTable->addColumn('name', 'string', ['length' => 60]);
     $myTable->setPrimaryKey(['id']);
     $myTable->addForeignKeyConstraint($UTable, array('user_id'), array('id'), array('onUpdate' => 'CASCADE'));
     $schemaM->createTable($UTable);
     $schemaM->createTable($myTable);
 }
开发者ID:eddmash,项目名称:powerorm,代码行数:30,代码来源:Testdb.php

示例3: executeChanges

 /**
  * Executes the changes.
  */
 public function executeChanges()
 {
     $platform = $this->db->getDatabasePlatform();
     if (!empty($this->dropTables)) {
         foreach ($this->dropTables as $t) {
             $this->sm->dropTable($this->prefix . $t);
         }
     }
     $sql = $this->schema->toSql($platform);
     if (!empty($sql)) {
         foreach ($sql as $s) {
             $this->db->executeUpdate($s);
         }
     }
     //reset schema
     $this->schema = new Schema([], [], $this->sm->createSchemaConfig());
     $this->dropTables = $this->addTables = [];
 }
开发者ID:dongilbert,项目名称:mautic,代码行数:21,代码来源:TableSchemaHelper.php

示例4: dropTable

 /**
  * {@inheritdoc}
  */
 public function dropTable($name)
 {
     $this->tryMethod('dropAutoincrement', $name);
     parent::dropTable($name);
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:8,代码来源:OracleSchemaManager.php

示例5: dropTable

 /**
  * @see AbstractSchemaManager::dropTable
  */
 public function dropTable($table)
 {
     $this->manager->dropTable($this->replacePrefix($table));
 }
开发者ID:enyaku,项目名称:myGoogleMapsApiV3Test,代码行数:7,代码来源:Utility.php

示例6: tearDown

 public function tearDown()
 {
     foreach ($this->_sm->listTableNames() as $tableName) {
         $this->_sm->dropTable($tableName);
     }
 }
开发者ID:crate,项目名称:crate-dbal,代码行数:6,代码来源:SchemaManagerTest.php


注:本文中的Doctrine\DBAL\Schema\AbstractSchemaManager::dropTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。