Skip to content

Commit

Permalink
Remove TableSchemaInterface::compositeForeignKey() method [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed May 9, 2024
1 parent f0f8d90 commit 9598d58
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Chg #837: Remove `$table` parameter from `normalizeColumnNames()` and `getNormalizeColumnNames()` methods
of `AbstractDMLQueryBuilder` class (@Tigrov)
- Chg #838: Remove `SchemaInterface::TYPE_JSONB` constant (@Tigrov)
- Chg #839: Remove `TableSchemaInterface::compositeForeignKey()` method (@Tigrov)

## 1.3.0 March 21, 2024

Expand Down
1 change: 1 addition & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ $db->createCommand()->insertBatch('user', $values)->execute();
### Remove deprecated methods

- `AbstractDMLQueryBuilder::getTypecastValue()`
- `TableSchemaInterface::compositeForeignKey()`

### Remove deprecated parameters

Expand Down
5 changes: 0 additions & 5 deletions src/Schema/AbstractTableSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,4 @@ public function foreignKey(string|int $id, array $to): void
{
$this->foreignKeys[$id] = $to;
}

public function compositeForeignKey(int $id, string $from, string $to): void
{
throw new NotSupportedException(static::class . ' does not support composite FK.');
}
}
13 changes: 0 additions & 13 deletions src/Schema/TableSchemaInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,4 @@ public function foreignKeys(array $value): void;
* @param array $to The foreign key.
*/
public function foreignKey(string|int $id, array $to): void;

/**
* Set composite foreign key.
*
* @param int $id The index of foreign key.
* @param string $from The column name in current table.
* @param string $to The column name in foreign table.
*
* @throws NotSupportedException
*
* @deprecated will be removed in version 2.0.0
*/
public function compositeForeignKey(int $id, string $from, string $to): void;
}
10 changes: 0 additions & 10 deletions tests/AbstractTableSchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ abstract class AbstractTableSchemaTest extends TestCase
{
use TestTrait;

public function testCompositeFk(): void
{
$tableSchema = new TableSchema();

$this->expectException(NotSupportedException::class);
$this->expectExceptionMessage('Yiisoft\Db\Tests\Support\Stub\TableSchema does not support composite FK.');

$tableSchema->compositeForeignKey(1, 'from', 'to');
}

public function testGetCatalogName(): void
{
$tableSchema = new TableSchema();
Expand Down

0 comments on commit 9598d58

Please sign in to comment.