Repository navigation
[#86] - make:model: a schema for each table - #112
Merged
Merged
Conversation
…eys and the classes of each schema, and <schema>.<table> for a table that is not in the default schema Assisted-by: Claude Code
…lass of a table of another schema, the keys between two schemas, and the servers Assisted-by: Claude Code
Assisted-by: Claude Code
…ude and models.classes Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ge run reaches the class check of one table Assisted-by: Claude Code
This comment has been minimized.
This comment has been minimized.
Code Metrics Report
Details | | master (ede84a3) | T86-make-model-schema-per-table | +/- |
| | | (d9864c4) | |
|---------------------|------------------|---------------------------------|-------|
+ | Coverage | 99.8% | 99.8% | +0.0% |
| Files | 97 | 97 | 0 |
| Lines | 4034 | 4196 | +162 |
+ | Covered | 4027 | 4189 | +162 |
- | Test Execution Time | 8s | 9s | +1s |Code coverage of files in pull request scope (100.0% → 100.0%, patch 100.0%)
Reported by octocov |
This was referenced Nov 28, 2026
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.
Hello!
In raising this pull request, I confirm the following:
composer test,composer csandcomposer analyzeall passmodels.schematakes a list of schemas, for example['public', 'billing']. The first is the default schema. A project with tables in more than one schema can use crest for all of them, and a foreign key between two schemas of the list gives a relation.The rules:
<schema>.<table>: inmake:model,make:scaffold,--exclude, the keys ofmodels.classesand theRelationAliaskeys.<default>.<table>is the table, also with a string key.make:model --allwrites a model for each table of each schema; each base callssetSchema()with the schema of its table, and its comment givesmake:model <schema>.<table>.did you mean <schema>.<table>?when another schema of the list has it.models.classesgives it a class. This also stops a run for one table before it writes over the base of the other table.getReferencedSchema(): a key to a schema of the list gives abelongsTo()and ahasMany(); a key to another schema gives aSkippedline that names the schema. A string, or no key, reads the keys as before. Before cphalcon 5.24.0, PostgreSQL gives the database as the referenced schema (cphalcon #17816), so there a list gives aSkippedline for each key;phalcon/phalconv6.0.xand cphalcon 5.24.0 have the fix.config:showshows the list.Changes in crest:
ModelNames: the list,schemas(),isList(),schemaOf()andtableOf()of a name,name(),nameOf(),withTables(), and the class check of a table of another schema.ModelTables::listed()(the tables and views of each schema),ForeignKeys::read()with theModelNamesof the run,ModelRelations(the reason of aSkippedline, the alias of a key of many columns),ModelProperties::ofName().model-base: the comment uses{{ name }};{{ table }}stays the table forsetSource(). A published copy works.Tests: unit, and
ModelCommandSchemasTeston MySQL, MariaDB and PostgreSQL (two schemas end to end, with rows read across the schemas). With ext-phalcon before 5.24.0, the 3 PostgreSQL tests of keys between schemas skip (skipReferencedSchemaOnOldCphalcon()). Infection on the changed generator files: MSI 100%.Thanks