本文整理汇总了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');
}
示例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);
}
}
示例4: down
public function down()
{
$tables = $this->tables;
$tables = array_reverse($tables);
foreach ($tables as $model) {
Schema::dropIfExists($model::getTableName());
}
}
示例5: down
/**
* Rollback the migration.
*/
public function down()
{
if (!$this->hasConnection()) {
Schema::dropIfExists($this->getTableName());
return;
}
Schema::connection($this->connection)->dropIfExists($this->getTableName());
}
示例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');
}
示例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.');
}
示例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();
}
}
示例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);
}
示例10: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('comments');
}
示例11: down
public function down()
{
Schema::dropIfExists('addresses');
}
示例12: down
/**
* Downgrade database.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
Schema::dropIfExists('cache');
Schema::dropIfExists('sessions');
}
示例13: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
foreach ($this->tables as $table) {
Schema::dropIfExists($table);
}
}
示例14: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('events');
//
}
示例15: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
Schema::dropIfExists('users');
}