diff --git a/UPGRADE.md b/UPGRADE.md
index c08b0eba54c..d95b54a627b 100644
--- a/UPGRADE.md
+++ b/UPGRADE.md
@@ -8,6 +8,15 @@ awareness about deprecated code.
# Upgrade to 4.0
+## Removed `AbstractPlatform` schema introspection methods
+
+The following schema introspection methods have been removed:
+
+- `AbstractPlatform::getListTableColumnsSQL()`,
+- `AbstractPlatform::getListTableIndexesSQL()`,
+- `AbstractPlatform::getListTableForeignKeysSQL()`,
+- `AbstractPlatform::getListTableConstraintsSQL()`.
+
## Abstract methods in the `AbstractSchemaManager` class have been declared as `abstract`
The following abstract methods in the `AbstractSchemaManager` class have been declared as `abstract`:
diff --git a/psalm.xml.dist b/psalm.xml.dist
index d1146b1105a..888f7071754 100644
--- a/psalm.xml.dist
+++ b/psalm.xml.dist
@@ -49,37 +49,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php
index 4bce6a7db2c..122ef177f57 100644
--- a/src/Platforms/AbstractMySQLPlatform.php
+++ b/src/Platforms/AbstractMySQLPlatform.php
@@ -113,60 +113,11 @@ public function getListDatabasesSQL(): string
return 'SHOW DATABASES';
}
- /**
- * @deprecated
- */
- public function getListTableConstraintsSQL(string $table): string
- {
- return 'SHOW INDEX FROM ' . $table;
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- *
- * {@inheritDoc}
- *
- * Two approaches to listing the table indexes. The information_schema is
- * preferred, because it doesn't cause problems with SQL keywords such as "order" or "table".
- */
- public function getListTableIndexesSQL(string $table, ?string $database = null): string
- {
- if ($database !== null) {
- return 'SELECT NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, COLUMN_NAME AS Column_Name,' .
- ' SUB_PART AS Sub_Part, INDEX_TYPE AS Index_Type' .
- ' FROM information_schema.STATISTICS WHERE TABLE_NAME = ' . $this->quoteStringLiteral($table) .
- ' AND TABLE_SCHEMA = ' . $this->quoteStringLiteral($database) .
- ' ORDER BY SEQ_IN_INDEX ASC';
- }
-
- return 'SHOW INDEX FROM ' . $table;
- }
-
public function getListViewsSQL(string $database): string
{
return 'SELECT * FROM information_schema.VIEWS WHERE TABLE_SCHEMA = ' . $this->quoteStringLiteral($database);
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableForeignKeysSQL(string $table, ?string $database = null): string
- {
- // The schema name is passed multiple times as a literal in the WHERE clause instead of using a JOIN condition
- // in order to avoid performance issues on MySQL older than 8.0 and the corresponding MariaDB versions
- // caused by https://bugs.mysql.com/bug.php?id=81347
- return 'SELECT k.CONSTRAINT_NAME, k.COLUMN_NAME, k.REFERENCED_TABLE_NAME, ' .
- 'k.REFERENCED_COLUMN_NAME /*!50116 , c.UPDATE_RULE, c.DELETE_RULE */ ' .
- 'FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE k /*!50116 ' .
- 'INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS c ON ' .
- 'c.CONSTRAINT_NAME = k.CONSTRAINT_NAME AND ' .
- 'c.TABLE_NAME = k.TABLE_NAME */ ' .
- 'WHERE k.TABLE_NAME = ' . $this->quoteStringLiteral($table) . ' ' .
- 'AND k.TABLE_SCHEMA = ' . $this->getDatabaseNameSQL($database) . ' /*!50116 ' .
- 'AND c.CONSTRAINT_SCHEMA = ' . $this->getDatabaseNameSQL($database) . ' */' .
- 'ORDER BY k.ORDINAL_POSITION';
- }
-
/**
* Gets the SQL snippet used to declare a CLOB column type.
* TINYTEXT : 2 ^ 8 - 1 = 255
@@ -261,42 +212,6 @@ public function getListTablesSQL(): string
return "SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'";
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableColumnsSQL(string $table, ?string $database = null): string
- {
- return 'SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, ' .
- 'COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Comment, ' .
- 'CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS Collation ' .
- 'FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ' . $this->getDatabaseNameSQL($database) . ' ' .
- 'AND TABLE_NAME = ' . $this->quoteStringLiteral($table) . ' ORDER BY ORDINAL_POSITION';
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableMetadataSQL(string $table, ?string $database = null): string
- {
- return sprintf(
- <<<'SQL'
-SELECT t.ENGINE,
- t.AUTO_INCREMENT,
- t.TABLE_COMMENT,
- t.CREATE_OPTIONS,
- t.TABLE_COLLATION,
- ccsa.CHARACTER_SET_NAME
-FROM information_schema.TABLES t
- INNER JOIN information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` ccsa
- ON ccsa.COLLATION_NAME = t.TABLE_COLLATION
-WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = %s AND TABLE_NAME = %s
-SQL
- ,
- $this->getDatabaseNameSQL($database),
- $this->quoteStringLiteral($table)
- );
- }
-
/**
* {@inheritDoc}
*/
@@ -890,16 +805,4 @@ public function supportsColumnLengthIndexes(): bool
{
return true;
}
-
- /**
- * Returns an SQL expression representing the given database name or current database name
- */
- private function getDatabaseNameSQL(?string $databaseName): string
- {
- if ($databaseName === null) {
- return $this->getCurrentDatabaseExpression();
- }
-
- return $this->quoteStringLiteral($databaseName);
- }
}
diff --git a/src/Platforms/AbstractPlatform.php b/src/Platforms/AbstractPlatform.php
index 2f9bd040fb9..1187c1e0e04 100644
--- a/src/Platforms/AbstractPlatform.php
+++ b/src/Platforms/AbstractPlatform.php
@@ -1980,21 +1980,6 @@ public function getListSequencesSQL(string $database): string
throw NotSupported::new(__METHOD__);
}
- /**
- * @deprecated
- *
- * @throws Exception If not supported on this platform.
- */
- public function getListTableConstraintsSQL(string $table): string
- {
- throw NotSupported::new(__METHOD__);
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- abstract public function getListTableColumnsSQL(string $table, ?string $database = null): string;
-
/**
* @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
*/
@@ -2005,25 +1990,6 @@ abstract public function getListTablesSQL(): string;
*/
abstract public function getListViewsSQL(string $database): string;
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- *
- * Returns the list of indexes for the current database.
- *
- * The current database parameter is optional but will always be passed
- * when using the SchemaManager API and is the database the given table is in.
- *
- * Attention: Some platforms only support currentDatabase when they
- * are connected with that database. Cross-database information schema
- * requests may be impossible.
- */
- abstract public function getListTableIndexesSQL(string $table, ?string $database = null): string;
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- abstract public function getListTableForeignKeysSQL(string $table, ?string $database = null): string;
-
public function getCreateViewSQL(string $name, string $sql): string
{
return 'CREATE VIEW ' . $name . ' AS ' . $sql;
diff --git a/src/Platforms/DB2Platform.php b/src/Platforms/DB2Platform.php
index de0ea49dfb3..13b46359798 100644
--- a/src/Platforms/DB2Platform.php
+++ b/src/Platforms/DB2Platform.php
@@ -198,60 +198,6 @@ public function getSetTransactionIsolationSQL(int $level): string
throw NotSupported::new(__METHOD__);
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- *
- * This code fragment is originally from the Zend_Db_Adapter_Db2 class, but has been edited.
- */
- public function getListTableColumnsSQL(string $table, ?string $database = null): string
- {
- $table = $this->quoteStringLiteral($table);
-
- // We do the funky subquery and join syscat.columns.default this crazy way because
- // as of db2 v10, the column is CLOB(64k) and the distinct operator won't allow a CLOB,
- // it wants shorter stuff like a varchar.
- return "
- SELECT
- cols.default,
- subq.*
- FROM (
- SELECT DISTINCT
- c.tabschema,
- c.tabname,
- c.colname,
- c.colno,
- c.typename,
- c.codepage,
- c.nulls,
- c.length,
- c.scale,
- c.identity,
- tc.type AS tabconsttype,
- c.remarks AS comment,
- k.colseq,
- CASE
- WHEN c.generated = 'D' THEN 1
- ELSE 0
- END AS autoincrement
- FROM syscat.columns c
- LEFT JOIN (syscat.keycoluse k JOIN syscat.tabconst tc
- ON (k.tabschema = tc.tabschema
- AND k.tabname = tc.tabname
- AND tc.type = 'P'))
- ON (c.tabschema = k.tabschema
- AND c.tabname = k.tabname
- AND c.colname = k.colname)
- WHERE UPPER(c.tabname) = UPPER(" . $table . ')
- ORDER BY c.colno
- ) subq
- JOIN syscat.columns cols
- ON subq.tabschema = cols.tabschema
- AND subq.tabname = cols.tabname
- AND subq.colno = cols.colno
- ORDER BY subq.colno
- ';
- }
-
public function getListTablesSQL(): string
{
return "SELECT NAME FROM SYSIBM.SYSTABLES WHERE TYPE = 'T'";
@@ -262,64 +208,6 @@ public function getListViewsSQL(string $database): string
return 'SELECT NAME, TEXT FROM SYSIBM.SYSVIEWS';
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableIndexesSQL(string $table, ?string $database = null): string
- {
- $table = $this->quoteStringLiteral($table);
-
- return "SELECT idx.INDNAME AS key_name,
- idxcol.COLNAME AS column_name,
- CASE
- WHEN idx.UNIQUERULE = 'P' THEN 1
- ELSE 0
- END AS primary,
- CASE
- WHEN idx.UNIQUERULE = 'D' THEN 1
- ELSE 0
- END AS non_unique
- FROM SYSCAT.INDEXES AS idx
- JOIN SYSCAT.INDEXCOLUSE AS idxcol
- ON idx.INDSCHEMA = idxcol.INDSCHEMA AND idx.INDNAME = idxcol.INDNAME
- WHERE idx.TABNAME = UPPER(" . $table . ')
- ORDER BY idxcol.COLSEQ ASC';
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableForeignKeysSQL(string $table, ?string $database = null): string
- {
- $table = $this->quoteStringLiteral($table);
-
- return "SELECT fkcol.COLNAME AS local_column,
- fk.REFTABNAME AS foreign_table,
- pkcol.COLNAME AS foreign_column,
- fk.CONSTNAME AS index_name,
- CASE
- WHEN fk.UPDATERULE = 'R' THEN 'RESTRICT'
- ELSE NULL
- END AS on_update,
- CASE
- WHEN fk.DELETERULE = 'C' THEN 'CASCADE'
- WHEN fk.DELETERULE = 'N' THEN 'SET NULL'
- WHEN fk.DELETERULE = 'R' THEN 'RESTRICT'
- ELSE NULL
- END AS on_delete
- FROM SYSCAT.REFERENCES AS fk
- JOIN SYSCAT.KEYCOLUSE AS fkcol
- ON fk.CONSTNAME = fkcol.CONSTNAME
- AND fk.TABSCHEMA = fkcol.TABSCHEMA
- AND fk.TABNAME = fkcol.TABNAME
- JOIN SYSCAT.KEYCOLUSE AS pkcol
- ON fk.REFKEYNAME = pkcol.CONSTNAME
- AND fk.REFTABSCHEMA = pkcol.TABSCHEMA
- AND fk.REFTABNAME = pkcol.TABNAME
- WHERE fk.TABNAME = UPPER(" . $table . ')
- ORDER BY fkcol.COLSEQ ASC';
- }
-
public function supportsCreateDropDatabase(): bool
{
return false;
@@ -721,20 +609,4 @@ protected function createReservedKeywordsList(): KeywordList
{
return new DB2Keywords();
}
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableCommentsSQL(string $table): string
- {
- return sprintf(
- <<<'SQL'
-SELECT REMARKS
- FROM SYSIBM.SYSTABLES
- WHERE NAME = UPPER( %s )
-SQL
- ,
- $this->quoteStringLiteral($table)
- );
- }
}
diff --git a/src/Platforms/OraclePlatform.php b/src/Platforms/OraclePlatform.php
index 177cf75995b..affa56504b6 100644
--- a/src/Platforms/OraclePlatform.php
+++ b/src/Platforms/OraclePlatform.php
@@ -341,48 +341,6 @@ protected function _getCreateTableSQL(string $name, array $columns, array $optio
return $sql;
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- *
- * {@inheritDoc}
- *
- * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaOracleReader.html
- */
- public function getListTableIndexesSQL(string $table, ?string $database = null): string
- {
- $table = $this->normalizeIdentifier($table);
- $table = $this->quoteStringLiteral($table->getName());
-
- return "SELECT uind_col.index_name AS name,
- (
- SELECT uind.index_type
- FROM user_indexes uind
- WHERE uind.index_name = uind_col.index_name
- ) AS type,
- decode(
- (
- SELECT uind.uniqueness
- FROM user_indexes uind
- WHERE uind.index_name = uind_col.index_name
- ),
- 'NONUNIQUE',
- 0,
- 'UNIQUE',
- 1
- ) AS is_unique,
- uind_col.column_name AS column_name,
- uind_col.column_position AS column_pos,
- (
- SELECT ucon.constraint_type
- FROM user_constraints ucon
- WHERE ucon.index_name = uind_col.index_name
- AND ucon.table_name = uind_col.table_name
- ) AS is_primary
- FROM user_ind_columns uind_col
- WHERE uind_col.table_name = " . $table . '
- ORDER BY uind_col.column_position ASC';
- }
-
public function getListTablesSQL(): string
{
return 'SELECT * FROM sys.user_tables';
@@ -527,93 +485,6 @@ private function getAutoincrementIdentifierName(Identifier $table): string
: $identifierName;
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableForeignKeysSQL(string $table, ?string $database = null): string
- {
- $table = $this->normalizeIdentifier($table);
- $table = $this->quoteStringLiteral($table->getName());
-
- return "SELECT alc.constraint_name,
- alc.DELETE_RULE,
- cols.column_name \"local_column\",
- cols.position,
- (
- SELECT r_cols.table_name
- FROM user_cons_columns r_cols
- WHERE alc.r_constraint_name = r_cols.constraint_name
- AND r_cols.position = cols.position
- ) AS \"references_table\",
- (
- SELECT r_cols.column_name
- FROM user_cons_columns r_cols
- WHERE alc.r_constraint_name = r_cols.constraint_name
- AND r_cols.position = cols.position
- ) AS \"foreign_column\"
- FROM user_cons_columns cols
- JOIN user_constraints alc
- ON alc.constraint_name = cols.constraint_name
- AND alc.constraint_type = 'R'
- AND alc.table_name = " . $table . '
- ORDER BY cols.constraint_name ASC, cols.position ASC';
- }
-
- /**
- * @deprecated
- */
- public function getListTableConstraintsSQL(string $table): string
- {
- $table = $this->normalizeIdentifier($table);
- $table = $this->quoteStringLiteral($table->getName());
-
- return 'SELECT * FROM user_constraints WHERE table_name = ' . $table;
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableColumnsSQL(string $table, ?string $database = null): string
- {
- $table = $this->normalizeIdentifier($table);
- $table = $this->quoteStringLiteral($table->getName());
-
- $tabColumnsTableName = 'user_tab_columns';
- $colCommentsTableName = 'user_col_comments';
- $tabColumnsOwnerCondition = '';
- $colCommentsOwnerCondition = '';
-
- if ($database !== null && $database !== '/') {
- $database = $this->normalizeIdentifier($database);
- $database = $this->quoteStringLiteral($database->getName());
- $tabColumnsTableName = 'all_tab_columns';
- $colCommentsTableName = 'all_col_comments';
- $tabColumnsOwnerCondition = ' AND c.owner = ' . $database;
- $colCommentsOwnerCondition = ' AND d.OWNER = c.OWNER';
- }
-
- return sprintf(
- <<<'SQL'
-SELECT c.*,
- (
- SELECT d.comments
- FROM %s d
- WHERE d.TABLE_NAME = c.TABLE_NAME%s
- AND d.COLUMN_NAME = c.COLUMN_NAME
- ) AS comments
-FROM %s c
-WHERE c.table_name = %s%s
-ORDER BY c.column_id
-SQL
- ,
- $colCommentsTableName,
- $colCommentsOwnerCondition,
- $tabColumnsTableName,
- $table,
- $tabColumnsOwnerCondition
- );
- }
-
public function getDropForeignKeySQL(string $foreignKey, string $table): string
{
return $this->getDropConstraintSQL($foreignKey, $table);
@@ -973,30 +844,4 @@ public function getBlobTypeDeclarationSQL(array $column): string
{
return 'BLOB';
}
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableCommentsSQL(string $table, ?string $database = null): string
- {
- $tableCommentsName = 'user_tab_comments';
- $ownerCondition = '';
-
- if ($database !== null && $database !== '/') {
- $tableCommentsName = 'all_tab_comments';
- $ownerCondition = ' AND owner = ' . $this->quoteStringLiteral(
- $this->normalizeIdentifier($database)->getName()
- );
- }
-
- return sprintf(
- <<<'SQL'
-SELECT comments FROM %s WHERE table_name = %s%s
-SQL
- ,
- $tableCommentsName,
- $this->quoteStringLiteral($this->normalizeIdentifier($table)->getName()),
- $ownerCondition
- );
- }
}
diff --git a/src/Platforms/PostgreSQLPlatform.php b/src/Platforms/PostgreSQLPlatform.php
index a821cb0716f..4e5aaea43e2 100644
--- a/src/Platforms/PostgreSQLPlatform.php
+++ b/src/Platforms/PostgreSQLPlatform.php
@@ -198,70 +198,6 @@ public function getListViewsSQL(string $database): string
WHERE view_definition IS NOT NULL';
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableForeignKeysSQL(string $table, ?string $database = null): string
- {
- return 'SELECT quote_ident(r.conname) as conname, pg_catalog.pg_get_constraintdef(r.oid, true) as condef
- FROM pg_catalog.pg_constraint r
- WHERE r.conrelid =
- (
- SELECT c.oid
- FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n
- WHERE ' . $this->getTableWhereClause($table) . " AND n.oid = c.relnamespace
- )
- AND r.contype = 'f'";
- }
-
- /**
- * @deprecated
- */
- public function getListTableConstraintsSQL(string $table): string
- {
- $table = new Identifier($table);
- $table = $this->quoteStringLiteral($table->getName());
-
- return sprintf(
- <<<'SQL'
-SELECT
- quote_ident(relname) as relname
-FROM
- pg_class
-WHERE oid IN (
- SELECT indexrelid
- FROM pg_index, pg_class
- WHERE pg_class.relname = %s
- AND pg_class.oid = pg_index.indrelid
- AND (indisunique = 't' OR indisprimary = 't')
- )
-SQL
- ,
- $table
- );
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- *
- * {@inheritDoc}
- *
- * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html
- */
- public function getListTableIndexesSQL(string $table, ?string $database = null): string
- {
- return 'SELECT quote_ident(relname) as relname, pg_index.indisunique, pg_index.indisprimary,
- pg_index.indkey, pg_index.indrelid,
- pg_get_expr(indpred, indrelid) AS where
- FROM pg_class, pg_index
- WHERE oid IN (
- SELECT indexrelid
- FROM pg_index si, pg_class sc, pg_namespace sn
- WHERE ' . $this->getTableWhereClause($table, 'sc', 'sn') . '
- AND sc.oid=si.indrelid AND sc.relnamespace = sn.oid
- ) AND pg_index.indexrelid = oid';
- }
-
private function getTableWhereClause(string $table, string $classAlias = 'c', string $namespaceAlias = 'n'): string
{
$whereClause = $namespaceAlias . ".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND ";
@@ -284,44 +220,6 @@ private function getTableWhereClause(string $table, string $classAlias = 'c', st
);
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableColumnsSQL(string $table, ?string $database = null): string
- {
- return "SELECT
- a.attnum,
- quote_ident(a.attname) AS field,
- t.typname AS type,
- format_type(a.atttypid, a.atttypmod) AS complete_type,
- (SELECT tc.collcollate FROM pg_catalog.pg_collation tc WHERE tc.oid = a.attcollation) AS collation,
- (SELECT t1.typname FROM pg_catalog.pg_type t1 WHERE t1.oid = t.typbasetype) AS domain_type,
- (SELECT format_type(t2.typbasetype, t2.typtypmod) FROM
- pg_catalog.pg_type t2 WHERE t2.typtype = 'd' AND t2.oid = a.atttypid) AS domain_complete_type,
- a.attnotnull AS isnotnull,
- (SELECT 't'
- FROM pg_index
- WHERE c.oid = pg_index.indrelid
- AND pg_index.indkey[0] = a.attnum
- AND pg_index.indisprimary = 't'
- ) AS pri,
- (SELECT pg_get_expr(adbin, adrelid)
- FROM pg_attrdef
- WHERE c.oid = pg_attrdef.adrelid
- AND pg_attrdef.adnum=a.attnum
- ) AS default,
- (SELECT pg_description.description
- FROM pg_description WHERE pg_description.objoid = c.oid AND a.attnum = pg_description.objsubid
- ) AS comment
- FROM pg_attribute a, pg_class c, pg_type t, pg_namespace n
- WHERE " . $this->getTableWhereClause($table, 'c', 'n') . '
- AND a.attnum > 0
- AND a.attrelid = c.oid
- AND a.atttypid = t.oid
- AND n.oid = c.relnamespace
- ORDER BY a.attnum';
- }
-
public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey): string
{
$query = '';
@@ -1020,22 +918,4 @@ private function isNumericType(Type $type): bool
{
return $type instanceof IntegerType || $type instanceof BigIntType;
}
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableMetadataSQL(string $table, ?string $schema = null): string
- {
- if ($schema !== null) {
- $table = $schema . '.' . $table;
- }
-
- return sprintf(
- <<<'SQL'
-SELECT obj_description(%s::regclass) AS table_comment;
-SQL
- ,
- $this->quoteStringLiteral($table)
- );
- }
}
diff --git a/src/Platforms/SQLServerPlatform.php b/src/Platforms/SQLServerPlatform.php
index 6b7aea61d14..960ca6e95e8 100644
--- a/src/Platforms/SQLServerPlatform.php
+++ b/src/Platforms/SQLServerPlatform.php
@@ -762,85 +762,6 @@ public function getListTablesSQL(): string
. " WHERE type = 'U' AND name != 'sysdiagrams' AND category != 2 ORDER BY name";
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableColumnsSQL(string $table, ?string $database = null): string
- {
- return "SELECT col.name,
- type.name AS type,
- col.max_length AS length,
- ~col.is_nullable AS notnull,
- def.definition AS [default],
- col.scale,
- col.precision,
- col.is_identity AS autoincrement,
- col.collation_name AS collation,
- CAST(prop.value AS NVARCHAR(MAX)) AS comment -- CAST avoids driver error for sql_variant type
- FROM sys.columns AS col
- JOIN sys.types AS type
- ON col.user_type_id = type.user_type_id
- JOIN sys.objects AS obj
- ON col.object_id = obj.object_id
- JOIN sys.schemas AS scm
- ON obj.schema_id = scm.schema_id
- LEFT JOIN sys.default_constraints def
- ON col.default_object_id = def.object_id
- AND col.object_id = def.parent_object_id
- LEFT JOIN sys.extended_properties AS prop
- ON obj.object_id = prop.major_id
- AND col.column_id = prop.minor_id
- AND prop.name = 'MS_Description'
- WHERE obj.type = 'U'
- AND " . $this->getTableWhereClause($table, 'scm.name', 'obj.name');
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableForeignKeysSQL(string $table, ?string $database = null): string
- {
- return 'SELECT f.name AS ForeignKey,
- SCHEMA_NAME (f.SCHEMA_ID) AS SchemaName,
- OBJECT_NAME (f.parent_object_id) AS TableName,
- COL_NAME (fc.parent_object_id,fc.parent_column_id) AS ColumnName,
- SCHEMA_NAME (o.SCHEMA_ID) ReferenceSchemaName,
- OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName,
- COL_NAME(fc.referenced_object_id,fc.referenced_column_id) AS ReferenceColumnName,
- f.delete_referential_action_desc,
- f.update_referential_action_desc
- FROM sys.foreign_keys AS f
- INNER JOIN sys.foreign_key_columns AS fc
- INNER JOIN sys.objects AS o ON o.OBJECT_ID = fc.referenced_object_id
- ON f.OBJECT_ID = fc.constraint_object_id
- WHERE ' .
- $this->getTableWhereClause($table, 'SCHEMA_NAME (f.schema_id)', 'OBJECT_NAME (f.parent_object_id)') .
- ' ORDER BY fc.constraint_column_id';
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableIndexesSQL(string $table, ?string $database = null): string
- {
- return "SELECT idx.name AS key_name,
- col.name AS column_name,
- ~idx.is_unique AS non_unique,
- idx.is_primary_key AS [primary],
- CASE idx.type
- WHEN '1' THEN 'clustered'
- WHEN '2' THEN 'nonclustered'
- ELSE NULL
- END AS flags
- FROM sys.tables AS tbl
- JOIN sys.schemas AS scm ON tbl.schema_id = scm.schema_id
- JOIN sys.indexes AS idx ON tbl.object_id = idx.object_id
- JOIN sys.index_columns AS idxcol ON idx.object_id = idxcol.object_id AND idx.index_id = idxcol.index_id
- JOIN sys.columns AS col ON idxcol.object_id = col.object_id AND idxcol.column_id = col.column_id
- WHERE " . $this->getTableWhereClause($table, 'scm.name', 'tbl.name') . '
- ORDER BY idx.index_id ASC, idxcol.key_ordinal ASC';
- }
-
public function getListViewsSQL(string $database): string
{
return "SELECT name, definition FROM sysobjects
@@ -1347,26 +1268,6 @@ protected function getCommentOnTableSQL(string $tableName, string $comment): str
);
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableMetadataSQL(string $table): string
- {
- return sprintf(
- <<<'SQL'
- SELECT
- p.value AS [table_comment]
- FROM
- sys.tables AS tbl
- INNER JOIN sys.extended_properties AS p ON p.major_id=tbl.object_id AND p.minor_id=0 AND p.class=1
- WHERE
- (tbl.name=N%s and SCHEMA_NAME(tbl.schema_id)=N'dbo' and p.name=N'MS_Description')
- SQL
- ,
- $this->quoteStringLiteral($table)
- );
- }
-
private function shouldAddOrderBy(string $query): bool
{
// Find the position of the last instance of ORDER BY and ensure it is not within a parenthetical statement
diff --git a/src/Platforms/SqlitePlatform.php b/src/Platforms/SqlitePlatform.php
index 42c67e14783..84d701421b0 100644
--- a/src/Platforms/SqlitePlatform.php
+++ b/src/Platforms/SqlitePlatform.php
@@ -378,33 +378,6 @@ public function getClobTypeDeclarationSQL(array $column): string
return 'CLOB';
}
- /**
- * @deprecated
- */
- public function getListTableConstraintsSQL(string $table): string
- {
- return sprintf(
- "SELECT sql FROM sqlite_master WHERE type='index' AND tbl_name = %s AND sql NOT NULL ORDER BY name",
- $this->quoteStringLiteral($table)
- );
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableColumnsSQL(string $table, ?string $database = null): string
- {
- return sprintf('PRAGMA table_info(%s)', $this->quoteStringLiteral($table));
- }
-
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableIndexesSQL(string $table, ?string $database = null): string
- {
- return sprintf('PRAGMA index_list(%s)', $this->quoteStringLiteral($table));
- }
-
public function getListTablesSQL(): string
{
return 'SELECT name FROM sqlite_master'
@@ -637,14 +610,6 @@ public function getCreateTableSQL(
return parent::getCreateTableSQL($table, $createFlags);
}
- /**
- * @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon.
- */
- public function getListTableForeignKeysSQL(string $table, ?string $database = null): string
- {
- return sprintf('PRAGMA foreign_key_list(%s)', $this->quoteStringLiteral($table));
- }
-
/**
* {@inheritDoc}
*/
diff --git a/src/Schema/AbstractSchemaManager.php b/src/Schema/AbstractSchemaManager.php
index 48f986d764c..0b56c082320 100644
--- a/src/Schema/AbstractSchemaManager.php
+++ b/src/Schema/AbstractSchemaManager.php
@@ -132,25 +132,6 @@ public function listTableColumns(string $table, ?string $database = null): array
__METHOD__
);
- $sql = $this->_platform->getListTableColumnsSQL($table, $database);
-
- $tableColumns = $this->_conn->fetchAllAssociative($sql);
-
- return $this->_getPortableTableColumnList($table, $database, $tableColumns);
- }
-
- /**
- * @return Column[]
- *
- * @throws Exception
- */
- protected function doListTableColumns(string $table, ?string $database = null): array
- {
- $database = $this->ensureDatabase(
- $database ?? $this->_conn->getDatabase(),
- __METHOD__
- );
-
return $this->_getPortableTableColumnList(
$table,
$database,
@@ -169,20 +150,6 @@ protected function doListTableColumns(string $table, ?string $database = null):
* @throws Exception
*/
public function listTableIndexes(string $table): array
- {
- $sql = $this->_platform->getListTableIndexesSQL($table, $this->_conn->getDatabase());
-
- $tableIndexes = $this->_conn->fetchAllAssociative($sql);
-
- return $this->_getPortableTableIndexesList($tableIndexes, $table);
- }
-
- /**
- * @return Index[]
- *
- * @throws Exception
- */
- protected function doListTableIndexes(string $table): array
{
$database = $this->ensureDatabase(
$this->_conn->getDatabase(),
@@ -403,23 +370,6 @@ public function listViews(): array
* @throws Exception
*/
public function listTableForeignKeys(string $table, ?string $database = null): array
- {
- if ($database === null) {
- $database = $this->_conn->getDatabase();
- }
-
- $sql = $this->_platform->getListTableForeignKeysSQL($table, $database);
- $tableForeignKeys = $this->_conn->fetchAllAssociative($sql);
-
- return $this->_getPortableTableForeignKeysList($tableForeignKeys);
- }
-
- /**
- * @return ForeignKeyConstraint[]
- *
- * @throws Exception
- */
- protected function doListTableForeignKeys(string $table, ?string $database = null): array
{
$database = $this->ensureDatabase(
$database ?? $this->_conn->getDatabase(),
diff --git a/src/Schema/DB2SchemaManager.php b/src/Schema/DB2SchemaManager.php
index 3c6addc7bdf..e1ff7b3959a 100644
--- a/src/Schema/DB2SchemaManager.php
+++ b/src/Schema/DB2SchemaManager.php
@@ -43,30 +43,6 @@ public function listTableNames(): array
return $this->filterAssetNames($this->_getPortableTablesList($tables));
}
- /**
- * {@inheritDoc}
- */
- public function listTableColumns(string $table, ?string $database = null): array
- {
- return $this->doListTableColumns($table, $database);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableIndexes(string $table): array
- {
- return $this->doListTableIndexes($table);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableForeignKeys(string $table, ?string $database = null): array
- {
- return $this->doListTableForeignKeys($table, $database);
- }
-
/**
* {@inheritdoc}
*
diff --git a/src/Schema/MySQLSchemaManager.php b/src/Schema/MySQLSchemaManager.php
index 166f12fce21..ec29209e052 100644
--- a/src/Schema/MySQLSchemaManager.php
+++ b/src/Schema/MySQLSchemaManager.php
@@ -50,30 +50,6 @@ class MySQLSchemaManager extends AbstractSchemaManager
"''" => "'",
];
- /**
- * {@inheritDoc}
- */
- public function listTableColumns(string $table, ?string $database = null): array
- {
- return $this->doListTableColumns($table, $database);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableIndexes(string $table): array
- {
- return $this->doListTableIndexes($table);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableForeignKeys(string $table, ?string $database = null): array
- {
- return $this->doListTableForeignKeys($table, $database);
- }
-
/**
* {@inheritdoc}
*/
diff --git a/src/Schema/OracleSchemaManager.php b/src/Schema/OracleSchemaManager.php
index a30b6cd1124..42a000dc8d5 100644
--- a/src/Schema/OracleSchemaManager.php
+++ b/src/Schema/OracleSchemaManager.php
@@ -31,30 +31,6 @@
*/
class OracleSchemaManager extends AbstractSchemaManager
{
- /**
- * {@inheritDoc}
- */
- public function listTableColumns(string $table, ?string $database = null): array
- {
- return $this->doListTableColumns($table, $database);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableIndexes(string $table): array
- {
- return $this->doListTableIndexes($table);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableForeignKeys(string $table, ?string $database = null): array
- {
- return $this->doListTableForeignKeys($table, $database);
- }
-
/**
* {@inheritdoc}
*/
diff --git a/src/Schema/PostgreSQLSchemaManager.php b/src/Schema/PostgreSQLSchemaManager.php
index 8a10467efad..47410f1302f 100644
--- a/src/Schema/PostgreSQLSchemaManager.php
+++ b/src/Schema/PostgreSQLSchemaManager.php
@@ -36,30 +36,6 @@ class PostgreSQLSchemaManager extends AbstractSchemaManager
{
private ?string $currentSchema = null;
- /**
- * {@inheritDoc}
- */
- public function listTableColumns(string $table, ?string $database = null): array
- {
- return $this->doListTableColumns($table, $database);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableIndexes(string $table): array
- {
- return $this->doListTableIndexes($table);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableForeignKeys(string $table, ?string $database = null): array
- {
- return $this->doListTableForeignKeys($table, $database);
- }
-
/**
* {@inheritDoc}
*/
diff --git a/src/Schema/SQLServerSchemaManager.php b/src/Schema/SQLServerSchemaManager.php
index 2e9381187ca..012f771081b 100644
--- a/src/Schema/SQLServerSchemaManager.php
+++ b/src/Schema/SQLServerSchemaManager.php
@@ -33,30 +33,6 @@ class SQLServerSchemaManager extends AbstractSchemaManager
{
private ?string $databaseCollation = null;
- /**
- * {@inheritDoc}
- */
- public function listTableColumns(string $table, ?string $database = null): array
- {
- return $this->doListTableColumns($table, $database);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableIndexes(string $table): array
- {
- return $this->doListTableIndexes($table);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableForeignKeys(string $table, ?string $database = null): array
- {
- return $this->doListTableForeignKeys($table, $database);
- }
-
/**
* {@inheritDoc}
*/
diff --git a/src/Schema/SqliteSchemaManager.php b/src/Schema/SqliteSchemaManager.php
index 868704e6b53..85afec7c195 100644
--- a/src/Schema/SqliteSchemaManager.php
+++ b/src/Schema/SqliteSchemaManager.php
@@ -41,22 +41,6 @@
*/
class SqliteSchemaManager extends AbstractSchemaManager
{
- /**
- * {@inheritDoc}
- */
- public function listTableColumns(string $table, ?string $database = null): array
- {
- return $this->doListTableColumns($table, $database);
- }
-
- /**
- * {@inheritDoc}
- */
- public function listTableIndexes(string $table): array
- {
- return $this->doListTableIndexes($table);
- }
-
public function renameTable(string $name, string $newName): void
{
$tableDiff = new TableDiff($name);
diff --git a/tests/Platforms/AbstractMySQLPlatformTestCase.php b/tests/Platforms/AbstractMySQLPlatformTestCase.php
index 64a1eaeb34c..427107d082a 100644
--- a/tests/Platforms/AbstractMySQLPlatformTestCase.php
+++ b/tests/Platforms/AbstractMySQLPlatformTestCase.php
@@ -836,22 +836,6 @@ public static function getGeneratesFloatDeclarationSQL(): iterable
];
}
- public function testQuotesTableNameInListTableIndexesSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\\\'",
- $this->platform->getListTableIndexesSQL("Foo'Bar\\", 'foo_db')
- );
- }
-
- public function testQuotesDatabaseNameInListTableIndexesSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\\\'",
- $this->platform->getListTableIndexesSQL('foo_table', "Foo'Bar\\")
- );
- }
-
public function testQuotesDatabaseNameInListViewsSQL(): void
{
self::assertStringContainsStringIgnoringCase(
@@ -860,50 +844,6 @@ public function testQuotesDatabaseNameInListViewsSQL(): void
);
}
- public function testQuotesTableNameInListTableForeignKeysSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\\\'",
- $this->platform->getListTableForeignKeysSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesDatabaseNameInListTableForeignKeysSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\\\'",
- $this->platform->getListTableForeignKeysSQL('foo_table', "Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\\\'",
- $this->platform->getListTableColumnsSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesDatabaseNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\\\'",
- $this->platform->getListTableColumnsSQL('foo_table', "Foo'Bar\\")
- );
- }
-
- public function testListTableForeignKeysSQLEvaluatesDatabase(): void
- {
- $sql = $this->platform->getListTableForeignKeysSQL('foo');
-
- self::assertStringContainsString('DATABASE()', $sql);
-
- $sql = $this->platform->getListTableForeignKeysSQL('foo', 'bar');
-
- self::assertStringContainsString('bar', $sql);
- self::assertStringNotContainsString('DATABASE()', $sql);
- }
-
public function testColumnCharsetDeclarationSQL(): void
{
self::assertSame(
diff --git a/tests/Platforms/DB2PlatformTest.php b/tests/Platforms/DB2PlatformTest.php
index 8b3ff36da31..78f62e3a561 100644
--- a/tests/Platforms/DB2PlatformTest.php
+++ b/tests/Platforms/DB2PlatformTest.php
@@ -674,28 +674,4 @@ protected function getGeneratesAlterTableRenameIndexUsedByForeignKeySQL(): array
{
return ['RENAME INDEX idx_foo TO idx_foo_renamed'];
}
-
- public function testQuotesTableNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableColumnsSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableIndexesSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableIndexesSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableForeignKeysSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableForeignKeysSQL("Foo'Bar\\")
- );
- }
}
diff --git a/tests/Platforms/OraclePlatformTest.php b/tests/Platforms/OraclePlatformTest.php
index cb5514a2bc4..0858a43e5f3 100644
--- a/tests/Platforms/OraclePlatformTest.php
+++ b/tests/Platforms/OraclePlatformTest.php
@@ -731,74 +731,6 @@ public function testQuotedTableNames(): void
self::assertEquals($createTriggerStatement, $sql[3]);
}
- /**
- * @dataProvider getReturnsGetListTableColumnsSQL
- */
- public function testReturnsGetListTableColumnsSQL(?string $database, string $expectedSql): void
- {
- // note: this assertion is a bit strict, as it compares a full SQL string.
- // Should this break in future, then please try to reduce the matching to substring matching while reworking
- // the tests
- self::assertEquals($expectedSql, $this->platform->getListTableColumnsSQL('"test"', $database));
- }
-
- /**
- * @return mixed[][]
- */
- public static function getReturnsGetListTableColumnsSQL(): iterable
- {
- return [
- [
- null,
- <<<'SQL'
-SELECT c.*,
- (
- SELECT d.comments
- FROM user_col_comments d
- WHERE d.TABLE_NAME = c.TABLE_NAME
- AND d.COLUMN_NAME = c.COLUMN_NAME
- ) AS comments
-FROM user_tab_columns c
-WHERE c.table_name = 'test'
-ORDER BY c.column_id
-SQL
-,
- ],
- [
- '/',
- <<<'SQL'
-SELECT c.*,
- (
- SELECT d.comments
- FROM user_col_comments d
- WHERE d.TABLE_NAME = c.TABLE_NAME
- AND d.COLUMN_NAME = c.COLUMN_NAME
- ) AS comments
-FROM user_tab_columns c
-WHERE c.table_name = 'test'
-ORDER BY c.column_id
-SQL
-,
- ],
- [
- 'scott',
- <<<'SQL'
-SELECT c.*,
- (
- SELECT d.comments
- FROM all_col_comments d
- WHERE d.TABLE_NAME = c.TABLE_NAME AND d.OWNER = c.OWNER
- AND d.COLUMN_NAME = c.COLUMN_NAME
- ) AS comments
-FROM all_tab_columns c
-WHERE c.table_name = 'test' AND c.owner = 'SCOTT'
-ORDER BY c.column_id
-SQL
-,
- ],
- ];
- }
-
protected function getQuotesReservedKeywordInUniqueConstraintDeclarationSQL(): string
{
return 'CONSTRAINT "select" UNIQUE (foo)';
@@ -838,46 +770,6 @@ public function testQuotesDatabaseNameInListSequencesSQL(): void
);
}
- public function testQuotesTableNameInListTableIndexesSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableIndexesSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableForeignKeysSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableForeignKeysSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableConstraintsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableConstraintsSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableColumnsSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesDatabaseNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableColumnsSQL('foo_table', "Foo'Bar\\")
- );
- }
-
/**
* @return array}>
*/
diff --git a/tests/Platforms/PostgreSQLPlatformTest.php b/tests/Platforms/PostgreSQLPlatformTest.php
index ea4d6cfc65e..4d1cfcd6217 100644
--- a/tests/Platforms/PostgreSQLPlatformTest.php
+++ b/tests/Platforms/PostgreSQLPlatformTest.php
@@ -853,62 +853,6 @@ public function testInitializesTsvectorTypeMapping(): void
self::assertEquals('text', $this->platform->getDoctrineTypeMapping('tsvector'));
}
- public function testQuotesTableNameInListTableForeignKeysSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableForeignKeysSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesSchemaNameInListTableForeignKeysSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableForeignKeysSQL("Foo'Bar\\.baz_table")
- );
- }
-
- public function testQuotesTableNameInListTableConstraintsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableConstraintsSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableIndexesSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableIndexesSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesSchemaNameInListTableIndexesSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableIndexesSQL("Foo'Bar\\.baz_table")
- );
- }
-
- public function testQuotesTableNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableColumnsSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesSchemaNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableColumnsSQL("Foo'Bar\\.baz_table")
- );
- }
-
public function testSupportsPartialIndexes(): void
{
self::assertTrue($this->platform->supportsPartialIndexes());
diff --git a/tests/Platforms/SQLServerPlatformTestCase.php b/tests/Platforms/SQLServerPlatformTestCase.php
index 1f411c6cffb..77438e205ec 100644
--- a/tests/Platforms/SQLServerPlatformTestCase.php
+++ b/tests/Platforms/SQLServerPlatformTestCase.php
@@ -1615,54 +1615,6 @@ public function testModifyLimitQueryWithNewlineBeforeOrderBy(): void
self::assertEquals($expectedSql, $sql);
}
- public function testQuotesTableNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableColumnsSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesSchemaNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableColumnsSQL("Foo'Bar\\.baz_table")
- );
- }
-
- public function testQuotesTableNameInListTableForeignKeysSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableForeignKeysSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesSchemaNameInListTableForeignKeysSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableForeignKeysSQL("Foo'Bar\\.baz_table")
- );
- }
-
- public function testQuotesTableNameInListTableIndexesSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableIndexesSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesSchemaNameInListTableIndexesSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableIndexesSQL("Foo'Bar\\.baz_table")
- );
- }
-
public function testGetDefaultValueDeclarationSQLForDateType(): void
{
$currentDateSql = $this->platform->getCurrentDateSQL();
diff --git a/tests/Platforms/SqlitePlatformTest.php b/tests/Platforms/SqlitePlatformTest.php
index d5c76249dca..2b208f2c186 100644
--- a/tests/Platforms/SqlitePlatformTest.php
+++ b/tests/Platforms/SqlitePlatformTest.php
@@ -720,38 +720,6 @@ protected function getGeneratesAlterTableRenameIndexUsedByForeignKeySQL(): array
];
}
- public function testQuotesTableNameInListTableConstraintsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableConstraintsSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableColumnsSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableColumnsSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableIndexesSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableIndexesSQL("Foo'Bar\\")
- );
- }
-
- public function testQuotesTableNameInListTableForeignKeysSQL(): void
- {
- self::assertStringContainsStringIgnoringCase(
- "'Foo''Bar\\'",
- $this->platform->getListTableForeignKeysSQL("Foo'Bar\\")
- );
- }
-
public function testDateAddStaticNumberOfDays(): void
{
self::assertSame(