當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。