当前位置: 首页>>代码示例>>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;未经允许,请勿转载。