Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/Database/Connections/MySqlConnection.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php namespace Winter\Storm\Database\Connections;

use Illuminate\Database\Schema\MySqlSchemaState;
use Illuminate\Filesystem\Filesystem;
use PDO;
use Illuminate\Database\PDO\MySqlDriver;
use Illuminate\Database\Schema\MySqlBuilder;
Expand Down Expand Up @@ -83,4 +85,26 @@
);
}
}

/**
* Determine if the connected database is a MariaDB database.
*
* @return bool
*/
public function isMaria()
{
return str_contains($this->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION), 'MariaDB');
}

/**
* Get the schema state for the connection.
*
* @param \Illuminate\Filesystem\Filesystem|null $files
* @param callable|null $processFactory
* @return \Illuminate\Database\Schema\MySqlSchemaState
*/
public function getSchemaState(Filesystem $files = null, callable $processFactory = null)

Check failure on line 106 in src/Database/Connections/MySqlConnection.php

View workflow job for this annotation

GitHub Actions / Code Analysis

Deprecated in PHP 8.4: Parameter #2 $processFactory (callable) is implicitly nullable via default value null.

Check failure on line 106 in src/Database/Connections/MySqlConnection.php

View workflow job for this annotation

GitHub Actions / Code Analysis

Deprecated in PHP 8.4: Parameter #1 $files (Illuminate\Filesystem\Filesystem) is implicitly nullable via default value null.
Comment thread
LukeTowers marked this conversation as resolved.
Outdated
{
return new MySqlSchemaState($this, $files, $processFactory);
}
}
14 changes: 14 additions & 0 deletions src/Database/Connections/PostgresConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
use Illuminate\Database\Schema\PostgresBuilder;
use Illuminate\Database\PDO\PostgresDriver;
use Illuminate\Database\Query\Processors\PostgresProcessor;
use Illuminate\Database\Schema\PostgresSchemaState;
use Illuminate\Filesystem\Filesystem;
use Winter\Storm\Database\Query\Grammars\PostgresGrammar as QueryGrammar;
use Illuminate\Database\Schema\Grammars\PostgresGrammar as SchemaGrammar;

Expand Down Expand Up @@ -64,4 +66,16 @@
{
return new PostgresDriver;
}

/**
* Get the schema state for the connection.
*
* @param \Illuminate\Filesystem\Filesystem|null $files
* @param callable|null $processFactory
* @return \Illuminate\Database\Schema\PostgresSchemaState
*/
public function getSchemaState(Filesystem $files = null, callable $processFactory = null)

Check failure on line 77 in src/Database/Connections/PostgresConnection.php

View workflow job for this annotation

GitHub Actions / Code Analysis

Deprecated in PHP 8.4: Parameter #2 $processFactory (callable) is implicitly nullable via default value null.

Check failure on line 77 in src/Database/Connections/PostgresConnection.php

View workflow job for this annotation

GitHub Actions / Code Analysis

Deprecated in PHP 8.4: Parameter #1 $files (Illuminate\Filesystem\Filesystem) is implicitly nullable via default value null.
Comment thread
LukeTowers marked this conversation as resolved.
Outdated
{
return new PostgresSchemaState($this, $files, $processFactory);
}
}
15 changes: 15 additions & 0 deletions src/Database/Connections/SQLiteConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
use Illuminate\Database\Schema\SQLiteBuilder;
use Illuminate\Database\Query\Processors\SQLiteProcessor;
use Illuminate\Database\PDO\SQLiteDriver;
use Illuminate\Database\Schema\SqliteSchemaState;
use Illuminate\Filesystem\Filesystem;
use Winter\Storm\Database\Query\Grammars\SQLiteGrammar as QueryGrammar;
use Illuminate\Database\Schema\Grammars\SQLiteGrammar as SchemaGrammar;

Expand Down Expand Up @@ -64,4 +66,17 @@
{
return new SQLiteDriver;
}

/**
* Get the schema state for the connection.
*
* @param \Illuminate\Filesystem\Filesystem|null $files
* @param callable|null $processFactory
*
* @throws \RuntimeException
*/
public function getSchemaState(Filesystem $files = null, callable $processFactory = null)

Check failure on line 78 in src/Database/Connections/SQLiteConnection.php

View workflow job for this annotation

GitHub Actions / Code Analysis

Deprecated in PHP 8.4: Parameter #2 $processFactory (callable) is implicitly nullable via default value null.

Check failure on line 78 in src/Database/Connections/SQLiteConnection.php

View workflow job for this annotation

GitHub Actions / Code Analysis

Deprecated in PHP 8.4: Parameter #1 $files (Illuminate\Filesystem\Filesystem) is implicitly nullable via default value null.
Comment thread
LukeTowers marked this conversation as resolved.
Outdated
{
return new SqliteSchemaState($this, $files, $processFactory);
}
}
21 changes: 19 additions & 2 deletions src/Database/Connections/SqlServerConnection.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<?php namespace Winter\Storm\Database\Connections;
<?php

namespace Winter\Storm\Database\Connections;

use Closure;
use Exception;
use Throwable;
use Illuminate\Database\Schema\SqlServerBuilder;
use Illuminate\Database\PDO\SqlServerDriver;
use Illuminate\Database\Query\Processors\SqlServerProcessor;
use Illuminate\Database\Schema\Grammars\SqlServerGrammar as SchemaGrammar;
use Illuminate\Filesystem\Filesystem;
use RuntimeException;
use Throwable;
use Winter\Storm\Database\Query\Grammars\SqlServerGrammar as QueryGrammar;

/**
Expand Down Expand Up @@ -110,4 +114,17 @@
{
return new SqlServerDriver;
}

/**
* Get the schema state for the connection.
*
* @param \Illuminate\Filesystem\Filesystem|null $files
* @param callable|null $processFactory
*
* @throws \RuntimeException
*/
public function getSchemaState(Filesystem $files = null, callable $processFactory = null)

Check failure on line 126 in src/Database/Connections/SqlServerConnection.php

View workflow job for this annotation

GitHub Actions / Code Analysis

Deprecated in PHP 8.4: Parameter #2 $processFactory (callable) is implicitly nullable via default value null.

Check failure on line 126 in src/Database/Connections/SqlServerConnection.php

View workflow job for this annotation

GitHub Actions / Code Analysis

Deprecated in PHP 8.4: Parameter #1 $files (Illuminate\Filesystem\Filesystem) is implicitly nullable via default value null.
Comment thread
LukeTowers marked this conversation as resolved.
Outdated
{
throw new RuntimeException('Schema dumping is not supported when using SQL Server.');
Comment thread
LukeTowers marked this conversation as resolved.
}
}
2 changes: 1 addition & 1 deletion src/Foundation/Providers/ArtisanServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ArtisanServiceProvider extends ArtisanServiceProviderBase
'ScheduleRun' => \Illuminate\Console\Scheduling\ScheduleRunCommand::class,
'ScheduleTest' => \Illuminate\Console\Scheduling\ScheduleTestCommand::class,
'ScheduleWork' => \Illuminate\Console\Scheduling\ScheduleWorkCommand::class,
'SchemaDump' => \Illuminate\Database\Console\DumpCommand::class,
'Up' => \Illuminate\Foundation\Console\UpCommand::class,
'ViewClear' => \Illuminate\Foundation\Console\ViewClearCommand::class,

Expand All @@ -58,7 +59,6 @@ class ArtisanServiceProvider extends ArtisanServiceProviderBase
// 'DbWipe' => WipeCommand::class,
// 'OptimizeClear' => OptimizeClearCommand::class,
// 'QueueClear' => QueueClearCommand::class,
// 'SchemaDump' => DumpCommand::class,
// 'ScheduleClearCache' => ScheduleClearCacheCommand::class,
// 'ViewCache' => ViewCacheCommand::class,

Expand Down
Loading