當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Schema::drop方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Schema::drop方法的典型用法代碼示例。如果您正苦於以下問題:PHP Schema::drop方法的具體用法?PHP Schema::drop怎麽用?PHP Schema::drop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Schema的用法示例。


在下文中一共展示了Schema::drop方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::drop('users');
     //delete everything inside the profile pictures directory
     $path = public_path() . '/content/profile_pictures/';
     File::deleteDirectory($path, true);
 }
開發者ID:elvinmakhmudov,項目名稱:shopping.app,代碼行數:12,代碼來源:2014_10_12_000000_create_users_table.php

示例2: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::drop('users');
     Schema::drop('towns');
     Schema::drop('educations');
     //
 }
開發者ID:jehaby,項目名稱:Cognitive,代碼行數:12,代碼來源:2015_11_02_202851_create_tables.php

示例3: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::drop('novels');
     Schema::drop('chapters');
     Schema::drop('configs');
     Schema::drop('mails');
 }
開發者ID:roslairy,項目名稱:nofetch,代碼行數:12,代碼來源:2015_08_26_120426_NoFetchMigration.php

示例4: drop

 /**
  * Overload the drop method of Schema to prevent the dropping
  * of core CMS tables
  * @param  $table
  * @return
  */
 public static function drop($table)
 {
     // Drop the table only if it isn't one of the core tables
     if (static::isNotCoreTable($table)) {
         parent::drop($table);
     }
 }
開發者ID:jrafaelca,項目名稱:Doptor,代碼行數:13,代碼來源:Schema.php

示例5: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('oauth_refresh_tokens', function (Blueprint $table) {
         $table->dropForeign('oauth_refresh_tokens_access_token_id_foreign');
     });
     Schema::drop('oauth_refresh_tokens');
 }
開發者ID:gabrielcabral,項目名稱:laravel-codedelivery,代碼行數:12,代碼來源:2014_04_24_111810_create_oauth_refresh_tokens_table.php

示例6: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('media', function (Blueprint $table) {
         $table->dropColumn('deleted_at');
     });
     Schema::drop('sample_mediables');
 }
開發者ID:plank,項目名稱:laravel-mediable,代碼行數:12,代碼來源:2016_06_27_000001_create_mediable_test_tables.php

示例7: importCertMongo

 public function importCertMongo($collection, $query)
 {
     $this->info("=========Import to: {$collection}============");
     $result = DB::connection('mysql')->select($this->getQuery($query, true));
     $rows = $result[0]->total;
     $this->info("Total de filas: {$rows}");
     $begin = 0;
     $block = 1000;
     $countBlock = 1;
     $fCsv = storage_path("app/{$collection}.csv");
     if (file_exists($fCsv)) {
         unlink($fCsv);
     }
     $fp = fopen($fCsv, 'w');
     fputs($fp, "organization, status, from, year, month, quarter, total \n");
     while ($rows > $begin) {
         $result = DB::connection('mysql')->select($this->getQuery($query, false, $begin, $block));
         foreach ($result as $key => $value) {
             $resultArray = json_decode(json_encode($value), true);
             fputs($fp, str_replace("\n", '', implode($resultArray, ',')) . "\n");
         }
         $this->info("End block {$countBlock}: " . date('H:i:s'));
         $begin += $block;
         $countBlock++;
     }
     fclose($fp);
     $this->info('End export to csv: ' . date('H:i:s'));
     Schema::drop($collection);
     $db = env('MONGO_DATABASE');
     $command = "mongoimport -d {$db} -c {$collection} --type csv --file {$fCsv} --headerline";
     shell_exec($command);
 }
開發者ID:MiguelPazo,項目名稱:ecmonitoring,代碼行數:32,代碼來源:LoadCert.php

示例8: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('manager_profile', function ($table) {
         $table->dropForeign('manager_profile_user_id_foreign');
     });
     Schema::drop('manager_profile');
 }
開發者ID:piyushsh,項目名稱:talenthub-website,代碼行數:12,代碼來源:2016_01_26_225731_creating_new_manager_profile_table.php

示例9: tearDown

 public function tearDown()
 {
     parent::tearDown();
     m::close();
     (new \UsersCreateTable())->down();
     Facades\Schema::drop('password_reminders');
 }
開發者ID:anlutro,項目名稱:l4-core,代碼行數:7,代碼來源:PasswordResetTest.php

示例10: down

 /**
  * Reverse the migrations.
  */
 public function down()
 {
     Schema::drop('account_modules', function (Blueprint $table) {
         $table->dropForeign('account_module_to_account');
         $table->dropForeign('account_module_to_module');
     });
 }
開發者ID:jaffle-be,項目名稱:framework,代碼行數:10,代碼來源:2015_08_25_085045_create_account_modules_table.php

示例11: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     if ($this->confirm("Clear database? [Yes|no]", "Yes")) {
         $this->info('Clear database start');
         if (config('database.default') == 'mysql') {
             DB::statement('SET FOREIGN_KEY_CHECKS=0');
         } else {
             if (config('database.default') == 'sqlite') {
                 DB::statement('PRAGMA foreign_keys = OFF');
             }
         }
         $tableNames = Schema::getConnection()->getDoctrineSchemaManager()->listTableNames();
         foreach ($tableNames as $v) {
             Schema::drop($v);
             $this->info('Dropped: ' . $v);
         }
         $this->info('Clear database end');
         if (config('database.default') == 'mysql') {
             DB::statement('SET FOREIGN_KEY_CHECKS=1');
         } else {
             if (config('database.default') == 'sqlite') {
                 DB::statement('PRAGMA foreign_keys = ON');
             }
         }
     }
 }
開發者ID:Mrzhanglu,項目名稱:ForoneAdministrator,代碼行數:31,代碼來源:ClearDatabase.php

示例12: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('oauth_auth_codes', function (Blueprint $t) {
         $t->dropForeign('oauth_auth_codes_session_id_foreign');
     });
     Schema::drop('oauth_auth_codes');
 }
開發者ID:nicklaw5,項目名稱:ticketing-system-api,代碼行數:12,代碼來源:2015_10_19_000010_create_oauth_auth_codes_table.php

示例13: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     //disable foreign key check for this connection before running seeders
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     Schema::drop('content_fields');
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
 }
開發者ID:xavierauana,項目名稱:events,代碼行數:12,代碼來源:2015_08_04_061038_create_content_fields_table.php

示例14: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('oauth_session_scopes', function (Blueprint $table) {
         $table->dropForeign('oauth_session_scopes_session_id_foreign');
         $table->dropForeign('oauth_session_scopes_scope_id_foreign');
     });
     Schema::drop('oauth_session_scopes');
 }
開發者ID:gabrielcabral,項目名稱:laravel-codedelivery,代碼行數:13,代碼來源:2014_04_24_111109_create_oauth_session_scopes_table.php

示例15: tearDown

 public function tearDown()
 {
     $this->operator->reset()->delete();
     if (Schema::hasTable('users')) {
         Schema::drop('users');
     }
     parent::tearDown();
 }
開發者ID:kyleing,項目名稱:laravel-tool,代碼行數:8,代碼來源:DBOperatorTest.php


注:本文中的Illuminate\Support\Facades\Schema::drop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。