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


PHP Schema::dropIfExists方法代码示例

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


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

示例1: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('object_revision');
     Schema::dropIfExists('object');
     Schema::dropIfExists('page_revision');
     Schema::dropIfExists('page');
 }
开发者ID:jvelo,项目名称:datatext,代码行数:12,代码来源:2016_01_24_000000_create_page_and_object_tables.php

示例2: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     $tables = ['attached', 'attaches'];
     foreach ($tables as $table) {
         Schema::dropIfExists($table);
     }
 }
开发者ID:AngryDeer,项目名称:Attachfiles,代码行数:12,代码来源:2016_01_30_014754_angrydeer_attachfiles_create_tables.php

示例3: dropIfExists

 /**
  * Overload the drop method of Schema to prevent the dropping
  * of core CMS tables
  * @param  $table
  * @return
  */
 public static function dropIfExists($table)
 {
     // Drop the table only if it isn't one of the core tables
     if (static::isNotCoreTable($table)) {
         parent::dropIfExists($table);
     }
 }
开发者ID:jrafaelca,项目名称:Doptor,代码行数:13,代码来源:Schema.php

示例4: down

 public function down()
 {
     $tables = $this->tables;
     $tables = array_reverse($tables);
     foreach ($tables as $model) {
         Schema::dropIfExists($model::getTableName());
     }
 }
开发者ID:xjtuwangke,项目名称:laravel-models,代码行数:8,代码来源:BasicMigration.php

示例5: down

 /**
  * Rollback the migration.
  */
 public function down()
 {
     if (!$this->hasConnection()) {
         Schema::dropIfExists($this->getTableName());
         return;
     }
     Schema::connection($this->connection)->dropIfExists($this->getTableName());
 }
开发者ID:ChenPeiyuan,项目名称:student-infomation-manager,代码行数:11,代码来源:Migration.php

示例6: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('history', function (Blueprint $table) {
         $table->dropForeign('history_type_id_foreign');
         $table->dropForeign('history_user_id_foreign');
     });
     Schema::dropIfExists('history_types');
     Schema::dropIfExists('history');
 }
开发者ID:rappasoft,项目名称:laravel-5-boilerplate,代码行数:14,代码来源:2016_07_03_062439_create_history_tables.php

示例7: process

 protected function process()
 {
     global $wpdb;
     // We need to create references to ms global tables to enable Network.
     foreach ($this->multisiteTables() as $table => $prefixed_table) {
         $this->line('Dropping table: ' . $prefixed_table);
         Schema::dropIfExists($prefixed_table);
     }
     $this->line('Done.');
 }
开发者ID:tvad911,项目名称:wordpress-plus,代码行数:10,代码来源:MultisiteUninstallCommand.php

示例8: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('attachments');
     // Create & attach new entity permissions
     $ops = ['Create All', 'Create Own', 'Update All', 'Update Own', 'Delete All', 'Delete Own'];
     $entity = 'Attachment';
     foreach ($ops as $op) {
         $permName = strtolower($entity) . '-' . strtolower(str_replace(' ', '-', $op));
         DB::table('role_permissions')->where('name', '=', $permName)->delete();
     }
 }
开发者ID:ssddanbrown,项目名称:bookstack,代码行数:16,代码来源:2016_10_09_142037_create_attachments_table.php

示例9: testMetaOperate

 public function testMetaOperate()
 {
     Schema::dropIfExists('users_meta');
     $mock = ['name' => 'hello', 'email' => 'gzhang@codelint.com', 'password' => md5('123456'), 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')];
     $user = $this->operator->reset()->insert($mock);
     // test auto build meta table
     $this->assertFalse(Schema::hasTable('users_meta'), 'expect users_meta not exist, but not');
     $this->operator->meta($user['id'], 'meta.key', $mock);
     $this->assertTrue(Schema::hasTable('users_meta'), 'expect users_meta exist, but not');
     // test find meta
     $value = $this->operator->meta($user['id'], 'meta.key');
     $this->assertEquals($mock, $value);
     // test set multi meta value
     $this->operator->metadata($user['id'], ['age' => 16, 'nick' => 'codelint', 'ext' => ['something...']]);
     $age = $this->operator->meta($user['id'], 'age');
     $this->assertEquals(16, $age);
     $nick = $this->operator->meta($user['id'], 'nick');
     $this->assertEquals('codelint', $nick);
     $metadata = $this->operator->metadata($user['id']);
     $this->assertEquals(['meta.key' => $mock, 'age' => 16, 'nick' => 'codelint', 'ext' => ['something...']], $metadata);
     $this->operator->metadata($user['id'], ['age' => 17, 'nick' => 'ray', 'sex' => '***']);
     $metadata = $this->operator->metadata($user['id']);
     $this->assertEquals(['meta.key' => $mock, 'age' => 17, 'nick' => 'ray', 'sex' => '***', 'ext' => ['something...']], $metadata);
 }
开发者ID:kyleing,项目名称:laravel-tool,代码行数:24,代码来源:DBOperatorTest.php

示例10: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('comments');
 }
开发者ID:aririfani,项目名称:laravel-rest-api,代码行数:9,代码来源:2016_10_01_111546_create_comments_table.php

示例11: down

 public function down()
 {
     Schema::dropIfExists('addresses');
 }
开发者ID:draperstudio,项目名称:laravel-addressable,代码行数:4,代码来源:create_addresses_table.php

示例12: down

 /**
  * Downgrade database.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('jobs');
     Schema::dropIfExists('cache');
     Schema::dropIfExists('sessions');
 }
开发者ID:suiyujin,项目名称:laravel5-handson,代码行数:11,代码来源:Framework_1_0.php

示例13: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     foreach ($this->tables as $table) {
         Schema::dropIfExists($table);
     }
 }
开发者ID:donny5300,项目名称:translations,代码行数:11,代码来源:2016_05_23_160820_create_translations_table.php

示例14: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('events');
     //
 }
开发者ID:BBerthod,项目名称:AgreenWeb,代码行数:10,代码来源:2016_12_01_135620_create_events_table.php

示例15: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('password_resets');
     Schema::dropIfExists('users');
 }
开发者ID:jumilla,项目名称:laravel-addon-auth,代码行数:10,代码来源:Auth_1_0.php


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