本文整理汇总了PHP中Doctrine\DBAL\Schema\Schema::dropTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::dropTable方法的具体用法?PHP Schema::dropTable怎么用?PHP Schema::dropTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\DBAL\Schema\Schema
的用法示例。
在下文中一共展示了Schema::dropTable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: down
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// Drop beer table
$schema->dropTable('beers');
// Drop messages table
$schema->dropTable('messages');
}
示例2: down
/**
* Down method
*
* @param Schema $schema
*/
public function down(Schema $schema)
{
if (Version::isSupportGetInstanceFunction()) {
$app = Application::getInstance();
$meta = $this->getMetadata($app['orm.em']);
$tool = new SchemaTool($app['orm.em']);
$schemaFromMetadata = $tool->getSchemaFromMetadata($meta);
// テーブル削除
foreach ($schemaFromMetadata->getTables() as $table) {
if ($schema->hasTable($table->getName())) {
$schema->dropTable($table->getName());
}
}
// シーケンス削除
foreach ($schemaFromMetadata->getSequences() as $sequence) {
if ($schema->hasSequence($sequence->getName())) {
$schema->dropSequence($sequence->getName());
}
}
} else {
if ($schema->hasTable(self::MAKER)) {
$schema->dropTable(self::MAKER);
}
if ($schema->hasTable(self::PRODUCTMAKER)) {
$schema->dropTable(self::PRODUCTMAKER);
}
}
if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') {
foreach ($this->sequence as $sequence) {
if ($schema->hasSequence($sequence)) {
$schema->dropSequence($sequence);
}
}
}
}
示例3: down
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$schema->dropTable('plg_maker_plugin');
$schema->dropTable('plg_maker');
$schema->dropTable('plg_product_maker');
}
示例4: down
/**
* Remove data.
*
* @param Schema $schema
*/
public function down(Schema $schema)
{
if (Version::isSupportGetInstanceFunction()) {
$app = Application::getInstance();
$meta = $this->getMetadata($app['orm.em']);
$tool = new SchemaTool($app['orm.em']);
$schemaFromMetadata = $tool->getSchemaFromMetadata($meta);
// テーブル削除
foreach ($schemaFromMetadata->getTables() as $table) {
if ($schema->hasTable($table->getName())) {
$schema->dropTable($table->getName());
}
}
// シーケンス削除
foreach ($schemaFromMetadata->getSequences() as $sequence) {
if ($schema->hasSequence($sequence->getName())) {
$schema->dropSequence($sequence->getName());
}
}
} else {
// this down() migration is auto-generated, please modify it to your needs
$schema->dropTable(self::NAME);
$schema->dropSequence('plg_recommend_product_recommend_product_id_seq');
}
}
示例5: down
/**
* remove table.
*
* @param Schema $schema
*/
public function down(Schema $schema)
{
//current version >= 3.0.9
if (Version::isSupportGetInstanceFunction()) {
$app = Application::getInstance();
$meta = $this->getMetadata($app['orm.em']);
$tool = new SchemaTool($app['orm.em']);
$schemaFromMetadata = $tool->getSchemaFromMetadata($meta);
// テーブル削除
foreach ($schemaFromMetadata->getTables() as $table) {
if ($schema->hasTable($table->getName())) {
$schema->dropTable($table->getName());
}
}
// シーケンス削除
foreach ($schemaFromMetadata->getSequences() as $sequence) {
if ($schema->hasSequence($sequence->getName())) {
$schema->dropSequence($sequence->getName());
}
}
//for delete sequence in postgresql
if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') {
$schema->dropSequence('plg_related_product_id_seq');
}
} else {
// this down() migration is auto-generated, please modify it to your needs
$schema->dropTable(self::NAME);
$schema->dropSequence('plg_related_product_id_seq');
}
}
示例6: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$this->fillActivityTables($queries);
$this->fillActivityListTables($queries);
// Remove orocrm_magento_cart_emails
$table = $schema->getTable('orocrm_magento_cart_emails');
$table->removeForeignKey('FK_11B0F84B1AD5CDBF');
$table->removeForeignKey('FK_11B0F84BA832C1C9');
$schema->dropTable('orocrm_magento_cart_emails');
// Remove orocrm_magento_cart_calls
$table = $schema->getTable('orocrm_magento_cart_calls');
$table->removeForeignKey('FK_83A847751AD5CDBF');
$table->removeForeignKey('FK_83A8477550A89B2C');
$schema->dropTable('orocrm_magento_cart_calls');
// Remove orocrm_magento_order_emails
$table = $schema->getTable('orocrm_magento_order_emails');
$table->removeForeignKey('FK_10E2A9508D9F6D38');
$table->removeForeignKey('FK_10E2A950A832C1C9');
$schema->dropTable('orocrm_magento_order_emails');
// Remove orocrm_magento_order_calls
$table = $schema->getTable('orocrm_magento_order_calls');
$table->removeForeignKey('FK_A885A3450A89B2C');
$table->removeForeignKey('FK_A885A348D9F6D38');
$schema->dropTable('orocrm_magento_order_calls');
}
示例7: down
public function down(Schema $schema)
{
$schema->dropTable('OAuthAuthCode');
$schema->dropTable('OAuthAccessToken');
$schema->dropTable('OAuthRefreshToken');
$schema->dropTable('OAuthClient');
}
示例8: down
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
$schema->dropTable('dict_topic');
$schema->dropTable('dict_source');
$schema->dropTable('dict_web');
$schema->dropTable('dict_ro');
$schema->dropTable('dict_queue');
}
示例9: down
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$schema->dropTable('plg_coupon');
$schema->dropSequence('plg_coupon_coupon_id_seq');
$schema->dropTable('plg_coupon_detail');
$schema->dropSequence('plg_coupon_detail_coupon_detail_id_seq');
$schema->dropTable('plg_coupon_order');
$schema->dropSequence('plg_coupon_order_id_seq');
}
示例10: down
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// this down() migration is auto-generated, please modify it to your needs
$schema->dropTable('plg_mailmaga_plugin');
// drop Sequence MailMagazine Plug-in
$schema->dropTable('plg_mailmaga_template');
$schema->dropTable('plg_send_history');
$schema->dropTable('plg_send_customer');
// drop sequence.
$schema->dropSequence('plg_mailmaga_template_template_id_seq');
$schema->dropSequence('plg_send_history_send_id_seq');
}
示例11: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$this->fillActivityTables($queries);
$this->fillActivityListTables($queries);
// Remove orocrm_contactus_req_emails
$table = $schema->getTable('orocrm_contactus_req_emails');
$table->removeForeignKey('FK_E494F7AE427EB8A5');
$table->removeForeignKey('FK_E494F7AEA832C1C9');
$schema->dropTable('orocrm_contactus_req_emails');
// Remove orocrm_contactus_request_calls
$table = $schema->getTable('orocrm_contactus_request_calls');
$table->removeForeignKey('FK_6F7A50CE427EB8A5');
$table->removeForeignKey('FK_6F7A50CE50A89B2C');
$schema->dropTable('orocrm_contactus_request_calls');
}
示例12: oroCrmCreateTaskTable
/**
* @param Schema $schema
*/
protected function oroCrmCreateTaskTable(Schema $schema)
{
if ($schema->hasTable($this->taskTableName)) {
$schema->dropTable($this->taskTableName);
}
$table = $schema->createTable($this->taskTableName);
$table->addColumn('id', 'integer', ['autoincrement' => true]);
$table->addColumn('subject', 'string', ['notnull' => false, 'length' => 255]);
$table->addColumn('description', 'string', ['notnull' => false, 'length' => 255]);
$table->addColumn('due_date', 'datetime');
$table->addColumn('task_priority_name', 'string', ['notnull' => false, 'length' => 32]);
$table->addColumn('owner_id', 'integer', ['notnull' => false]);
$table->addColumn('related_account_id', 'integer', ['notnull' => false]);
$table->addColumn('related_contact_id', 'integer', ['notnull' => false]);
$table->addColumn('reporter_id', 'integer', ['notnull' => false]);
$table->addColumn('workflow_item_id', 'integer', ['notnull' => false]);
$table->addColumn('workflow_step_id', 'integer', ['notnull' => false]);
$table->addColumn('createdAt', 'datetime');
$table->addColumn('updatedAt', 'datetime', ['notnull' => false]);
$table->setPrimaryKey(['id']);
$table->addIndex(['task_priority_name'], 'IDX_814DEE3FD34C1E8E', []);
$table->addIndex(['owner_id'], 'IDX_814DEE3F7E3C61F9', []);
$table->addIndex(['related_account_id'], 'IDX_814DEE3FE774F01D', []);
$table->addIndex(['related_contact_id'], 'IDX_814DEE3FD6204081', []);
$table->addIndex(['reporter_id'], 'IDX_814DEE3FE1CFE6F5', []);
$table->addIndex(['due_date'], 'task_due_date_idx');
$table->addUniqueIndex(['workflow_item_id'], 'UNIQ_814DEE3F1023C4EE');
$table->addIndex(['workflow_step_id'], 'IDX_814DEE3F71FE882C', []);
$this->oroCrmCreateTaskTableForeignKeys($schema);
}
示例13: down
public function down(Schema $schema)
{
//start cc_show_instances modifications
$show_instances_table = $schema->getTable('cc_show_instances');
$show_instances_table->dropColumn('record');
$show_instances_table->dropColumn('rebroadcast');
$show_instances_table->dropColumn('instance_id');
$show_instances_table->dropColumn('file_id');
$show_instances_table->dropColumn('soundcloud_id');
//end cc_show_instances modifications
//start cc_show_days modifications
$show_days_table = $schema->getTable('cc_show_days');
$show_days_table->dropColumn('record');
//end cc_show_days modifications
//start cc_show modifications
$show_table = $schema->getTable('cc_show');
$show_table->dropColumn('url');
//end cc_show modifications
//start cc_schedule modifications
$schedule_table = $schema->getTable('cc_schedule');
$playlist_id_col = $schedule_table->getColumn('playlist_id');
$playlist_id_col->setNotnull(true);
//end cc_schedule modifications
//drop cc_show_rebroadcast table
$schema->dropTable('cc_show_rebroadcast');
//end drop cc_show_rebroadcast table
}
示例14: up
/**
* Attributes table was not used in the code anymore so can be removed
*
* @param Schema $schema
*/
public function up(Schema $schema)
{
$prefixedTableName = $this->getTablePrefix() . 'attribute';
if ($schema->hasTable($prefixedTableName)) {
$schema->dropTable($prefixedTableName);
}
}
示例15: down
public function down(Schema $schema)
{
$tables = ['module', 'module_admin', 'user', 'user_provider'];
foreach ($tables as $table) {
$schema->dropTable($table);
}
}