Skip to content

Remove unused schema methods #1175

Open

Description

@Tigrov

Description

SchemaInterface::

  • getSchemaChecks()
  • getSchemaDefaultValues()
  • getSchemaIndexes()
  • getSchemaPrimaryKeys()
  • getSchemaUniques()

interface ConstraintSchemaInterface
{
/**
* Returns check constraints for all tables in the database.
*
* @param string $schema The schema of the tables. Defaults to empty string, meaning the current or default schema
* name.
* @param bool $refresh Whether to fetch the latest available table schemas. If this is `false`, cached data may be
* returned if available.
*
* @return Check[] The check constraints for all tables in the database.
*/
public function getSchemaChecks(string $schema = '', bool $refresh = false): array;
/**
* Returns default value constraints for all tables in the database.
*
* @param string $schema The schema of the tables. Defaults to empty string, meaning the current or default schema
* name.
* @param bool $refresh Whether to fetch the latest available table schemas. If this is `false`, cached data may be
* returned if available.
*
* @return DefaultValue[] The default value constraints for all tables in the database.
*/
public function getSchemaDefaultValues(string $schema = '', bool $refresh = false): array;
/**
* Returns foreign keys for all tables in the database.
*
* @param string $schema The schema of the tables. Defaults to empty string, meaning the current or default schema
* name.
* @param bool $refresh Whether to fetch the latest available table schemas. If this is `false`, cached data may be
* returned if available.
*
* @return ForeignKey[] The foreign keys for all tables in the database.
*/
public function getSchemaForeignKeys(string $schema = '', bool $refresh = false): array;
/**
* Returns indexes for all tables in the database.
*
* @param string $schema The schema of the tables. Defaults to empty string, meaning the current or default schema
* name.
* @param bool $refresh Whether to fetch the latest available table schemas. If this is false, cached data may be
* returned if available.
*
* @return Index[] The indexes for all tables in the database.
*/
public function getSchemaIndexes(string $schema = '', bool $refresh = false): array;
/**
* Returns primary keys for all tables in the database.
*
* @param string $schema The schema of the tables. Defaults to empty string, meaning the current or default schema
* name.
* @param bool $refresh Whether to fetch the latest available table schemas. If this is `false`, cached data may be
* returned if available.
*
* @return Index[] The primary keys for all tables in the database.
*/
public function getSchemaPrimaryKeys(string $schema = '', bool $refresh = false): array;
/**
* Returns unique constraints for all tables in the database.
*
* @param string $schema The schema of the tables. Defaults to empty string, meaning the current or default schema
* name.
* @param bool $refresh Whether to fetch the latest available table schemas. If this is `false`, cached data may be
* returned if available.
*
* @return Index[] The unique constraints for all tables in the database.
*/
public function getSchemaUniques(string $schema = '', bool $refresh = false): array;

Package version

2

PHP version

any

Activity

  1. changed the title [-]Schema methods should return values with related table names[/-] [+]Remove unused schema methods[/+] on Apr 24, 2026
  2. added this to the 3.0.0 milestone on Apr 24, 2026
  3. samdark commented on Apr 27, 2026

    @samdark
    Member

    👍

  4. added 2 commits that reference this issue on Aug 2, 2026
    798ba75
    a4cc7ff
  5. KalimeroMK commented on Aug 2, 2026

    @KalimeroMK
    Contributor

    I have this ready as a coordinated set of five PRs, all green on CI:

    Repository PR Change
    yiisoft/db #1191 Removes the five methods from ConstraintSchemaInterface and AbstractSchema
    yiisoft/db-mysql yiisoft/db-mysql#477 Removes two tests that call the removed methods
    yiisoft/db-pgsql yiisoft/db-pgsql#502 Removes one test, adds coverage through getTableDefaultValues()
    yiisoft/db-oracle yiisoft/db-oracle#407 Removes one test
    yiisoft/db-sqlite yiisoft/db-sqlite#428 Removes Schema::getSchemaDefaultValues() (cleanup only)
  6. vjik commented on Aug 2, 2026

    @vjik
    Member

    @KalimeroMK Thanks for contributing! I'd appreciate it if you could avoid posting low-quality or unreviewed AI-generated content in PRs and issues, as in the previous message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions