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


PHP Builder::dropIfExists方法代码示例

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


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

示例1: down

 /**
  * Undo the migration
  */
 public function down()
 {
     //Drop foreign
     $this->schema->table('likes', function ($table) {
         $table->dropForeign('likes_user_id_foreign');
     });
     $this->schema->dropIfExists('likes');
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:11,代码来源:20160205182727_CreateLikeTable.php

示例2: handle

 /**
  * Handle the event.
  *
  * @param AssignmentWasDeleted $event
  */
 public function handle(AssignmentWasDeleted $event)
 {
     $assignment = $event->getAssignment();
     $fieldType = $assignment->getFieldType();
     if (!$fieldType instanceof MultipleFieldType) {
         return;
     }
     $this->schema->dropIfExists($fieldType->getPivotTableName());
 }
开发者ID:bloveless,项目名称:multiple-field_type,代码行数:14,代码来源:DropPivotTable.php

示例3: handle

 /**
  * Handle the event.
  *
  * @param AssignmentWasDeleted $event
  */
 public function handle(AssignmentWasDeleted $event)
 {
     $assignment = $event->getAssignment();
     $fieldType = $assignment->getFieldType();
     if (!$fieldType instanceof FilesFieldType) {
         return;
     }
     $this->schema->dropIfExists($table = $assignment->getStreamPrefix() . $assignment->getStreamSlug() . '_' . $fieldType->getField());
 }
开发者ID:samharrison7,项目名称:files-field_type,代码行数:14,代码来源:DropPivotTable.php

示例4: handle

 /**
  * Install the extensions table.
  */
 public function handle()
 {
     $this->schema->dropIfExists('addons_extensions');
     $this->schema->create('addons_extensions', function (Blueprint $table) {
         $table->increments('id');
         $table->string('slug');
         $table->boolean('installed')->default(0);
         $table->boolean('enabled')->default(0);
     });
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:13,代码来源:InstallExtensionsTableHandler.php

示例5: down

 /**
  * Undo the migration
  */
 public function down()
 {
     //Drop foreign keys
     $this->schema->table('friend_requests', function ($table) {
         $table->dropForeign('friend_requests_sender_foreign');
         $table->dropForeign('friend_requests_receiver_foreign');
     });
     //Drop table
     $this->schema->dropIfExists('friend_requests');
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:13,代码来源:20160222184600_CreateFriendRequestTable.php

示例6: down

 /**
  * Undo the migration
  */
 public function down()
 {
     //Drop foreign keys
     $this->schema->table('lecturers_courses_faculties', function ($table) {
         $table->dropForeign('lecturer_courses_faculties_uom_id_foreign');
         $table->dropForeign('lecturer_courses_faculties_faculty_id_foreign');
         $table->dropForeign('lecturer_courses_faculties_course_id_foreign');
     });
     //Drop table
     $this->schema->dropIfExists('lecturers_courses_faculties');
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:14,代码来源:20160302175103_CreateLecturerFacultyCoursesTable.php

示例7: handle

 /**
  * Handle the event.
  *
  * @param AssignmentWasCreated $event
  */
 public function handle(AssignmentWasCreated $event)
 {
     $assignment = $event->getAssignment();
     $fieldType = $assignment->getFieldType();
     if (!$fieldType instanceof FilesFieldType) {
         return;
     }
     $table = $assignment->getStreamPrefix() . $assignment->getStreamSlug() . '_' . $fieldType->getField();
     $this->schema->dropIfExists($table);
     $this->schema->create($table, function (Blueprint $table) {
         $table->integer('entry_id');
         $table->integer('file_id');
         $table->integer('sort_order')->nullable();
         $table->primary(['entry_id', 'file_id']);
     });
 }
开发者ID:samharrison7,项目名称:files-field_type,代码行数:21,代码来源:CreatePivotTable.php

示例8: down

 /**
  * Destroy the tables.
  * 
  * @param  \Illuminate\Console\Command  $command
  * @return void
  */
 public function down(Command $command)
 {
     foreach ($this->tables as $table) {
         $this->dropping($command, $table);
         $this->schema->dropIfExists($table);
         $this->done($command);
     }
 }
开发者ID:ash-rain,项目名称:oauth2-server-laravel,代码行数:14,代码来源:TableBuilder.php

示例9: handle

 /**
  * Handle the event.
  *
  * @param AssignmentWasCreated $event
  */
 public function handle(AssignmentWasCreated $event)
 {
     $assignment = $event->getAssignment();
     $fieldType = $assignment->getFieldType();
     if (!$fieldType instanceof MultipleFieldType) {
         return;
     }
     $table = array_get($fieldType->getConfig(), 'pivot_table', $assignment->getStreamPrefix() . $assignment->getStreamSlug() . '_' . $fieldType->getField());
     $foreignKey = $fieldType->getForeignKey();
     $otherKey = $fieldType->getOtherKey();
     $this->schema->dropIfExists($table);
     $this->schema->create($table, function (Blueprint $table) use($foreignKey, $otherKey) {
         $table->increments('id');
         $table->integer($foreignKey);
         $table->integer($otherKey);
     });
 }
开发者ID:bloveless,项目名称:multiple-field_type,代码行数:22,代码来源:CreatePivotTable.php

示例10: dropIfExists

 /**
  * Drop a table from the schema if it exists.
  *
  * @param string $table
  * @return \Illuminate\Database\Schema\Blueprint 
  * @static 
  */
 public static function dropIfExists($table)
 {
     return \Illuminate\Database\Schema\Builder::dropIfExists($table);
 }
开发者ID:poovarasanvasudevan,项目名称:voice-app,代码行数:11,代码来源:_ide_helper.php

示例11: downTable

 public function downTable(Builder $builder)
 {
     $builder->dropIfExists($this->table);
 }
开发者ID:chatbox-inc,项目名称:apiauth,代码行数:4,代码来源:UserTable.php

示例12: down

 /**
  * Undo the migration
  */
 public function down()
 {
     //Drop table
     $this->schema->dropIfExists('account_status');
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:8,代码来源:20151017193305_CreateAccountStatusTable.php

示例13: drop

 public function drop($table)
 {
     $this->builder->dropIfExists($table);
 }
开发者ID:bugotech,项目名称:database,代码行数:4,代码来源:Migration.php

示例14: dropTable

 /**
  * Drop a table.
  *
  * @param $table
  */
 public function dropTable($table)
 {
     $this->schema->dropIfExists($table);
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:9,代码来源:StreamSchema.php

示例15: dropIfExists

 /**
  * Indicate that the table should be dropped if it exists.
  *
  * @return \Illuminate\Support\Fluent
  */
 public function dropIfExists($table)
 {
     $this->helper->dropAutoIncrementObjects($table);
     parent::dropIfExists($table);
 }
开发者ID:rafael-renan-pacheco,项目名称:laravel-oci8,代码行数:10,代码来源:OracleBuilder.php


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