本文整理汇总了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);
}
示例2: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
Schema::drop('towns');
Schema::drop('educations');
//
}
示例3: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('novels');
Schema::drop('chapters');
Schema::drop('configs');
Schema::drop('mails');
}
示例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);
}
}
示例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');
}
示例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);
}
示例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');
}
示例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');
});
}
示例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');
}
}
}
}
示例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;');
}
示例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();
}