Skip to content

Commit

Permalink
[11.x] Remove Database Deprecations (#49810)
Browse files Browse the repository at this point in the history
* remove schema deprecations

* formatting

* force re-run tests
  • Loading branch information
hafezdivandari authored Jan 24, 2024
1 parent 7dcd191 commit 4187b06
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 477 deletions.
15 changes: 0 additions & 15 deletions src/Illuminate/Database/Query/Processors/MySqlProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@

class MySqlProcessor extends Processor
{
/**
* Process the results of a column listing query.
*
* @deprecated Will be removed in a future Laravel version.
*
* @param array $results
* @return array
*/
public function processColumnListing($results)
{
return array_map(function ($result) {
return ((object) $result)->column_name;
}, $results);
}

/**
* Process the results of a columns query.
*
Expand Down
15 changes: 0 additions & 15 deletions src/Illuminate/Database/Query/Processors/PostgresProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@ public function processInsertGetId(Builder $query, $sql, $values, $sequence = nu
return is_numeric($id) ? (int) $id : $id;
}

/**
* Process the results of a column listing query.
*
* @deprecated Will be removed in a future Laravel version.
*
* @param array $results
* @return array
*/
public function processColumnListing($results)
{
return array_map(function ($result) {
return ((object) $result)->column_name;
}, $results);
}

/**
* Process the results of a types query.
*
Expand Down
13 changes: 0 additions & 13 deletions src/Illuminate/Database/Query/Processors/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,4 @@ public function processForeignKeys($results)
{
return $results;
}

/**
* Process the results of a column listing query.
*
* @deprecated Will be removed in a future Laravel version.
*
* @param array $results
* @return array
*/
public function processColumnListing($results)
{
return $results;
}
}
15 changes: 0 additions & 15 deletions src/Illuminate/Database/Query/Processors/SQLiteProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@

class SQLiteProcessor extends Processor
{
/**
* Process the results of a column listing query.
*
* @deprecated Will be removed in a future Laravel version.
*
* @param array $results
* @return array
*/
public function processColumnListing($results)
{
return array_map(function ($result) {
return ((object) $result)->name;
}, $results);
}

/**
* Process the results of a columns query.
*
Expand Down
15 changes: 0 additions & 15 deletions src/Illuminate/Database/Query/Processors/SqlServerProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,6 @@ protected function processInsertGetIdForOdbc(Connection $connection)
return is_object($row) ? $row->insertid : $row['insertid'];
}

/**
* Process the results of a column listing query.
*
* @deprecated Will be removed in a future Laravel version.
*
* @param array $results
* @return array
*/
public function processColumnListing($results)
{
return array_map(function ($result) {
return ((object) $result)->name;
}, $results);
}

/**
* Process the results of a columns query.
*
Expand Down
14 changes: 0 additions & 14 deletions src/Illuminate/Database/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,20 +206,6 @@ public function getTypes()
throw new LogicException('This database driver does not support user-defined types.');
}

/**
* Get all of the table names for the database.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return array
*
* @throws \LogicException
*/
public function getAllTables()
{
throw new LogicException('This database driver does not support getting all tables.');
}

/**
* Determine if the given table has a given column.
*
Expand Down
48 changes: 0 additions & 48 deletions src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@ public function compileDropDatabaseIfExists($name)
);
}

/**
* Compile the query to determine the list of tables.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileTableExists()
{
return "select * from information_schema.tables where table_schema = ? and table_name = ? and table_type = 'BASE TABLE'";
}

/**
* Compile the query to determine the tables.
*
Expand Down Expand Up @@ -111,42 +99,6 @@ public function compileViews($database)
);
}

/**
* Compile the SQL needed to retrieve all table names.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileGetAllTables()
{
return 'SHOW FULL TABLES WHERE table_type = \'BASE TABLE\'';
}

/**
* Compile the SQL needed to retrieve all view names.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileGetAllViews()
{
return 'SHOW FULL TABLES WHERE table_type = \'VIEW\'';
}

/**
* Compile the query to determine the list of columns.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileColumnListing()
{
return 'select column_name as `column_name` from information_schema.columns where table_schema = ? and table_name = ?';
}

/**
* Compile the query to determine the columns.
*
Expand Down
62 changes: 0 additions & 62 deletions src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ public function compileDropDatabaseIfExists($name)
);
}

/**
* Compile the query to determine if a table exists.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileTableExists()
{
return "select * from information_schema.tables where table_catalog = ? and table_schema = ? and table_name = ? and table_type = 'BASE TABLE'";
}

/**
* Compile the query to determine the tables.
*
Expand Down Expand Up @@ -121,44 +109,6 @@ public function compileTypes()
."and n.nspname not in ('pg_catalog', 'information_schema')";
}

/**
* Compile the SQL needed to retrieve all table names.
*
* @deprecated Will be removed in a future Laravel version.
*
* @param string|array $searchPath
* @return string
*/
public function compileGetAllTables($searchPath)
{
return "select tablename, concat('\"', schemaname, '\".\"', tablename, '\"') as qualifiedname from pg_catalog.pg_tables where schemaname in ('".implode("','", (array) $searchPath)."')";
}

/**
* Compile the SQL needed to retrieve all view names.
*
* @deprecated Will be removed in a future Laravel version.
*
* @param string|array $searchPath
* @return string
*/
public function compileGetAllViews($searchPath)
{
return "select viewname, concat('\"', schemaname, '\".\"', viewname, '\"') as qualifiedname from pg_catalog.pg_views where schemaname in ('".implode("','", (array) $searchPath)."')";
}

/**
* Compile the query to determine the list of columns.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileColumnListing()
{
return 'select column_name from information_schema.columns where table_catalog = ? and table_schema = ? and table_name = ?';
}

/**
* Compile the query to determine the columns.
*
Expand Down Expand Up @@ -510,18 +460,6 @@ public function compileDropAllDomains($domains)
return 'drop domain '.implode(',', $this->escapeNames($domains)).' cascade';
}

/**
* Compile the SQL needed to retrieve all type names.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileGetAllTypes()
{
return 'select distinct pg_type.typname from pg_type inner join pg_enum on pg_enum.enumtypid = pg_type.oid';
}

/**
* Compile a drop column command.
*
Expand Down
49 changes: 0 additions & 49 deletions src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ class SQLiteGrammar extends Grammar
*/
protected $serials = ['bigInteger', 'integer', 'mediumInteger', 'smallInteger', 'tinyInteger'];

/**
* Compile the query to determine if a table exists.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileTableExists()
{
return "select * from sqlite_master where type = 'table' and name = ?";
}

/**
* Compile the query to determine the SQL text that describes the given object.
*
Expand Down Expand Up @@ -92,43 +80,6 @@ public function compileViews()
return "select name, sql as definition from sqlite_master where type = 'view' order by name";
}

/**
* Compile the SQL needed to retrieve all table names.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileGetAllTables()
{
return 'select type, name from sqlite_master where type = \'table\' and name not like \'sqlite_%\'';
}

/**
* Compile the SQL needed to retrieve all view names.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileGetAllViews()
{
return 'select type, name from sqlite_master where type = \'view\'';
}

/**
* Compile the query to determine the list of columns.
*
* @deprecated Will be removed in a future Laravel version.
*
* @param string $table
* @return string
*/
public function compileColumnListing($table)
{
return 'pragma table_info('.$this->wrap(str_replace('.', '__', $table)).')';
}

/**
* Compile the query to determine the columns.
*
Expand Down
49 changes: 0 additions & 49 deletions src/Illuminate/Database/Schema/Grammars/SqlServerGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@ public function compileDropDatabaseIfExists($name)
);
}

/**
* Compile the query to determine if a table exists.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileTableExists()
{
return "select * from sys.sysobjects where id = object_id(?) and xtype in ('U', 'V')";
}

/**
* Compile the query to determine the tables.
*
Expand Down Expand Up @@ -105,43 +93,6 @@ public function compileViews()
.'order by name';
}

/**
* Compile the SQL needed to retrieve all table names.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileGetAllTables()
{
return "select name, type from sys.tables where type = 'U'";
}

/**
* Compile the SQL needed to retrieve all view names.
*
* @deprecated Will be removed in a future Laravel version.
*
* @return string
*/
public function compileGetAllViews()
{
return "select name, type from sys.objects where type = 'V'";
}

/**
* Compile the query to determine the list of columns.
*
* @deprecated Will be removed in a future Laravel version.
*
* @param string $table
* @return string
*/
public function compileColumnListing($table)
{
return "select name from sys.columns where object_id = object_id('$table')";
}

/**
* Compile the query to determine the columns.
*
Expand Down
Loading

0 comments on commit 4187b06

Please sign in to comment.