Skip to content

T87 make model sqlite foreign keys - #106

Merged
niden merged 4 commits into
masterfrom
T87-make-model-sqlite-foreign-keys
Nov 27, 2026
Merged

niden merged 4 commits into
masterfrom
T87-make-model-sqlite-foreign-keys

Conversation

@niden

@niden niden commented Nov 27, 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

SQLite foreign keys in make:model. The fixes are in Phalcon: phalcon/cphalcon#17814 (a composite key gave one key for each column) and phalcon/cphalcon#17815 (a key with no referenced columns gave null for the column). Both come in cphalcon 5.24.0 and phalcon/phalcon 6.0.0. Crest needs no code change.

The lock moves phalcon/phalcon to v6.0.x at a845ec7, which has the sync commits of the two fixes and of phalcon/cphalcon#17816. No other package changes.

On SQLite, the composite-key tests of MySQL and PostgreSQL now run too, with a real key in the SQLite tables lines and shipments. A new test checks that REFERENCES customers gives a relation to customers(id). With cphalcon before 5.24.0, these tests skip: skipCompositeKeyOnOldCphalcon() now covers SQLite too, and skipKeyWithNoColumnsOnOldCphalcon() is new. The v5 CI cells install cphalcon 5.23.0 until #100, so these tests run in the v6 cells.

Crest still skips a key with no referenced columns from an older Phalcon. The three tests of that skip get the old form from ListedReferencesSqlite (was CompositeKeySqlite), so they run on each version. CompositeKeyFront and the two SQLite composite-key tests with the test adapter are removed. phpstan has one ignore for the null column in that test.

The docs give the versions for the two SQLite limits.

Thanks

@niden niden mentioned this pull request Nov 27, 2026
3 of 4 tasks
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Code Metrics Report

master (e599c9f) T87-make-model-sqlite-foreign-keys (2d8c2b4) +/-
Coverage 99.8% 99.8% 0.0%
Test Execution Time 11s 12s +1s
Details
  |                     | master (e599c9f) | T87-make-model-sqlite-foreign-keys | +/-  |
  |                     |                  |             (2d8c2b4)              |      |
  |---------------------|------------------|------------------------------------|------|
  | Coverage            |            99.8% |                              99.8% | 0.0% |
  |   Files             |               97 |                                 97 |    0 |
  |   Lines             |             4003 |                               4003 |    0 |
  |   Covered           |             3996 |                               3996 |    0 |
- | Test Execution Time |              11s |                                12s |  +1s |

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

Files Coverage +/- Status
src/Generator/ModelRelations.php 100.0% 0.0% modified

Reported by octocov

@niden
niden merged commit 026e7df into master Nov 27, 2026
40 checks passed
@niden
niden deleted the T87-make-model-sqlite-foreign-keys branch November 27, 2026 20:56
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