Conversation
…ation bugs - bin/ef: fall back to project-root autoload.php when installed as a Composer package (the old path resolved inside the package and failed) - Console commands: replace hardcoded __DIR__ config path with getcwd()/config so migrate/rollback/tenant:create resolve against the consuming project - MigrationBuilder: always prepend id and tenant_id columns; add FK column definitions before CONSTRAINT lines; map datetime type to DATETIME; skip id/tenant_id/FK columns from the fields loop to prevent duplicates - MigrationBuilderTest: update assertions and add coverage for new behaviour
…table output - MigrationBuilder: always prepend id PK; conditionally add tenant_id based on strategy (shared/database); emit FK column definitions before CONSTRAINT; use Str::toTableName() for snake_case plural table names - EntitySchema: remove isMultiTenant(); remove tenant_id injection from getFields(); timestamps use datetime type; getPrimaryKey() always returns 'id' - EntityGenerator: accept $strategy param; pass to MigrationBuilder; use Str::toTableName() for migration file basenames - EntityBuilder: delegate pluralisation to Str::pluralize() - Support/Str: new utility with toTableName() (snake_case + pluralize) and pluralize() - BaseRepository: create() returns lastInsertId(); resolveTableName() uses Str::toTableName() - MigrationRunner: injectable output callable; replaces all echo with ($this->output)() - GenerateAllCommand/GenerateCommand: load strategy from config/application.yaml; pass to generator; simplify pkMap to array_fill_keys - MigrateCommand/RollbackCommand/MigrateAllTenantsCommand: inject Symfony output callable into MigrationRunner - Tests: remove dead isMultiTenant tests; add database strategy test; update OrderItem table name assertion; add lastInsertId assertions to create() tests
… provisioning guard - MigrationBuilder: unique indexes in shared strategy now prepend tenant_id so the constraint is scoped per-tenant, not globally unique - Request::capture(): detects application/json Content-Type and parses php://input instead of relying on $_POST; adds json() helper method - TenantService::onboard(): only calls provisioner->create() for database strategy; shared strategy registers the tenant row without provisioning a DB
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- Request: test json() method and capture() JSON content-type branch - EntitySchema: test getPrimaryKey() - BaseRepository: test resolveTableName() via reflection - MigrationBuilder: test default TEXT mapping for unknown field types - ConsoleCommands: test strategy loading from application.yaml for both GenerateCommand and GenerateAllCommand
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bin/efautoload path — Fixed resolution when installed as a Composer dependency (previously resolved inside the vendor package directory)getcwd() . '/config'instead of__DIR__-relative paths, so they work correctly from any project rootStr::toTableName()with proper snake_case and English pluralisation (JournalEntry→journal_entries, notjournalentrys). Used consistently acrossMigrationBuilder,EntityBuilder, andBaseRepositoryMigrationBuildernow accepts a$strategyparameter;tenant_idcolumn is only emitted for thesharedstrategy.GenerateCommandandGenerateAllCommandreadtenancy.strategyfromconfig/application.yamland pass it throughsharedstrategy automatically prependtenant_idas the first column, preventing cross-tenant unique constraint violationsbelongsTorelations now emitINT NOT NULLFK columns (previously missingNOT NULL)datetimetype — Maps toDATETIMESQL type (previously fell through toTEXT)BaseRepository::create()— Now returns the inserted row withidpopulated vialastInsertId()MigrationRunneroutput — Accepts an injectable?callable $outputin the constructor; defaults toecho. Console commands inject$output->writeln()for Symfony Console formattingTenantService::onboard()— Only callsTenantProvisioner::create()fordatabasestrategy;sharedstrategy registers the tenant row without provisioning a databaseRequest::capture()— Detectsapplication/jsonContent-Type and parsesphp://inputinstead of relying on$_POST. Addedjson()helper method