Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 9, 2024
1 parent 055e1cd commit 63ea4d6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Console/ShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ShowCommand extends DatabaseInspectionCommand
{--json : Output the database information as JSON}
{--counts : Show the table row count <bg=red;options=bold> Note: This can be slow on large databases </>}
{--views : Show the database views <bg=red;options=bold> Note: This can be slow on large databases </>}
{--types : Show the user-defined types}';
{--types : Show the user defined types}';

/**
* The console command description.
Expand Down
2 changes: 0 additions & 2 deletions src/Illuminate/Database/Console/TableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ class TableCommand extends DatabaseInspectionCommand
public function handle(ConnectionResolverInterface $connections)
{
$connection = $connections->connection($this->input->getOption('database'));

$schema = $connection->getSchemaBuilder();

$tables = $schema->getTables();

$tableName = $this->argument('table') ?: select(
Expand Down
8 changes: 5 additions & 3 deletions src/Illuminate/Database/Query/Processors/SQLiteProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ public function processColumns($results, $sql = '')

$type = strtolower($result->type);

$collation = preg_match('/\b'.preg_quote($result->name)
.'\b[^,(]+(?:\([^()]+\)[^,]*)?(?:(?:default|check|as)\s*(?:\(.*?\))?[^,]*)*collate\s+["\'`]?(\w+)/i',
$sql, $matches) === 1 ? strtolower($matches[1]) : null;
$collation = preg_match(
'/\b'.preg_quote($result->name).'\b[^,(]+(?:\([^()]+\)[^,]*)?(?:(?:default|check|as)\s*(?:\(.*?\))?[^,]*)*collate\s+["\'`]?(\w+)/i',
$sql,
$matches
) === 1 ? strtolower($matches[1]) : null;

return [
'name' => $result->name,
Expand Down
5 changes: 2 additions & 3 deletions src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,8 @@ public function compileRenameColumn(Blueprint $blueprint, Fluent $command, Conne
{
$version = $connection->getServerVersion();

if (($connection->isMaria() && version_compare($version, '10.5.2', '<'))
|| (! $connection->isMaria() && version_compare($version, '8.0.3', '<'))
) {
if (($connection->isMaria() && version_compare($version, '10.5.2', '<')) ||
(! $connection->isMaria() && version_compare($version, '8.0.3', '<'))) {
$column = collect($connection->getSchemaBuilder()->getColumns($blueprint->getTable()))
->firstWhere('name', $command->from);

Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ protected function getForeignKey($foreign)

// If this foreign key specifies the action to be taken on update we will add
// that to the statement here. We'll append it to this SQL and then return
// the SQL so we can keep adding any other foreign constraints onto this.
// this SQL so we can keep adding any other foreign constraints to this.
if (! is_null($foreign->onUpdate)) {
$sql .= " on update {$foreign->onUpdate}";
}
Expand Down Expand Up @@ -572,7 +572,7 @@ public function compileRenameIndex(Blueprint $blueprint, Fluent $command, Connec
}

if ($index['primary']) {
throw new RuntimeException('Sqlite does not support alter primary key.');
throw new RuntimeException('SQLite does not support altering primary keys.');
}

if ($index['unique']) {
Expand Down

0 comments on commit 63ea4d6

Please sign in to comment.