Skip to content

Schema: preserve released CREATE TABLE override signature - #270

Merged
JJJ merged 1 commit into
masterfrom
fix/schema-create-signature
Sep 22, 2026
Merged

JJJ merged 1 commit into
masterfrom
fix/schema-create-signature

Conversation

@JJJ

@JJJ JJJ commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Schema::get_create_table_string( bool $with_foreign_keys = false ) rejects subclasses that override the released 3.0.1 zero-argument method: loading such a subclass raises a PHP declaration fatal. Restore the zero-argument signature and have Table::create() append the existing get_foreign_key_strings() fragments when inline foreign keys are enabled. This preserves subclass dispatch and inline foreign-key SQL without another Schema method.

The regression fixture uses a Schema subclass with the released signature and verifies that inline table creation calls its override and emits the foreign key. The changelog and DDL comments now describe the compatible contract.

Validation: PHP 8.1 and 8.2 WordPress 6.7/MariaDB 10.2 suites (1,790 tests, 3,984 assertions each); PHPStan level 8; PHPCS; Composer validation; git diff --check.

@JJJ
JJJ force-pushed the fix/schema-create-signature branch from c741da7 to 50925c5 Compare September 22, 2026 21:21
@JJJ
JJJ merged commit f3ff97a into master Sep 22, 2026
6 checks passed
@JJJ
JJJ deleted the fix/schema-create-signature branch September 22, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant