Skip to content

T69 make model from table - #76

Merged
niden merged 5 commits into
masterfrom
T69-make-model-from-table
Nov 10, 2026
Merged

niden merged 5 commits into
masterfrom
T69-make-model-from-table

Conversation

@niden

@niden niden commented Nov 10, 2026

Copy link
Copy Markdown
Member

Hello!

In raising this pull request, I confirm the following:

  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • composer test, composer cs and composer analyze all pass
  • I have created a PR for the documentation about this change, if user facing

  • Added the models.schema key to crest.php: make:model and make:scaffold read the tables of that schema, and the base calls setSchema(). One schema applies to all the tables.
  • Added ModelNames::schemaOf(), schema() and checkSchema(), ForeignKeys::elsewhere() and the MVC stub fragment-model-schema.
  • Changed make:model: with models.schema, a published model-base needs {{ schema }}. Publish it again with crest stub:publish model-base --force.
  • Changed ModelProperties::of() and ForeignKeys::read(): each one takes the schema as an optional last parameter.
  • Fixed make:model: a foreign key to a table of another schema no longer gives a relation to a model of the wrong table. It gives a Skipped line.

Thanks

niden added 5 commits November 4, 2026 19:58
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted by: Claude Code
@niden niden self-assigned this Nov 10, 2026
@niden niden added the enhancement New feature or request label Nov 10, 2026
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Code Metrics Report

master (46479f9) #76 (3acff44) +/-
Coverage 99.7% 99.7% +0.0%
Test Execution Time 9s 8s -1s
Details
  |                     | master (46479f9) | #76 (3acff44) |  +/-  |
  |---------------------|------------------|---------------|-------|
+ | Coverage            |            99.7% |         99.7% | +0.0% |
  |   Files             |               91 |            91 |     0 |
  |   Lines             |             3395 |          3491 |   +96 |
+ |   Covered           |             3388 |          3484 |   +96 |
+ | Test Execution Time |               9s |            8s |   -1s |

Code coverage of files in pull request scope (100.0% → 100.0%, patch 100.0%)

Files Coverage +/- Patch Coverage Status
src/Command/Config/ShowCommand.php 100.0% 0.0% 100.0% modified
src/Command/Make/ModelCommand.php 100.0% 0.0% 100.0% modified
src/Command/Make/ScaffoldCommand.php 100.0% 0.0% 100.0% modified
src/Generator/ForeignKeys.php 100.0% 0.0% 100.0% modified
src/Generator/ModelNames.php 100.0% 0.0% 100.0% modified
src/Generator/ModelProperties.php 100.0% 0.0% 100.0% modified
src/Generator/ModelRelations.php 100.0% 0.0% 100.0% modified
src/Generator/ModelTables.php 100.0% 0.0% 100.0% modified

Reported by octocov

@niden
niden merged commit 05c09ac into master Nov 10, 2026
40 checks passed
@niden
niden deleted the T69-make-model-from-table branch November 10, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant