This commit is contained in:
2026-05-01 23:40:14 +08:00
commit b8f599a617
3867 changed files with 478663 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
<?php
namespace Illuminate\Database\Schema;
class MySqlBuilder extends Builder
{
/**
* Drop all tables from the database.
*
* @return void
*/
public function dropAllTables()
{
$tables = $this->getTableListing($this->getCurrentSchemaListing());
if (empty($tables)) {
return;
}
$this->disableForeignKeyConstraints();
try {
$this->connection->statement(
$this->grammar->compileDropAllTables($tables)
);
} finally {
$this->enableForeignKeyConstraints();
}
}
/**
* Drop all views from the database.
*
* @return void
*/
public function dropAllViews()
{
$views = array_column($this->getViews($this->getCurrentSchemaListing()), 'schema_qualified_name');
if (empty($views)) {
return;
}
$this->connection->statement(
$this->grammar->compileDropAllViews($views)
);
}
/**
* Get the names of current schemas for the connection.
*
* @return string[]|null
*/
public function getCurrentSchemaListing()
{
return [$this->connection->getDatabaseName()];
}
}