You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BUGFIX] #673: generate ext_tables.sql CREATE TABLE for models without own properties (#812)
* [TASK] Fix#673: generate ext_tables.sql CREATE TABLE for models without own properties
When a domain object has no own properties but is the target of a
ZeroToMany inline relation, the FK column for that relation must still
appear in ext_tables.sql. The template condition previously skipped the
entire CREATE TABLE block, silently dropping the FK column and leaving
the database table uncreated.
- Extend the template condition in extTables.sqlt to also check for
incoming FK relations via listForeignKeyRelations
- Add validation warning in ExtensionValidator when a domain object
has no properties (warns user that no CREATE TABLE will be generated)
- Add functional test verifying the FK column is included in
ext_tables.sql for a child model with no own properties
- Add unit test for the new validation warning
- Update phpstan-baseline.neon for 2 new LF usages
- Update ChangeLog
* [BUGFIX] Suppress no-properties warning when domain object is inline FK target
The validation warning added in #812 fired for all domain objects with no
own properties, including those that are the target of a ZeroToMany inline
relation. For these objects the template correctly generates a CREATE TABLE
(via the FK column condition added in the same PR), so the warning message
was factually incorrect.
Fix: only emit the warning when the domain object has neither own properties
nor any incoming inline FK relation.
Also adds a unit test covering the suppressed-warning case.
Copy file name to clipboardExpand all lines: Documentation/ChangeLog/Index.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ Change log
9
9
Version 13.1.0
10
10
--------------
11
11
12
+
* [BUGFIX] ``ext_tables.sql`` now includes a ``CREATE TABLE`` statement for models that have no own properties but are the target of a ``ZeroToMany inline`` relation — previously the FK column was silently dropped, leaving the database table uncreated.
13
+
* [BUGFIX] A validation warning is now shown when a domain object has no properties, informing the user that no ``CREATE TABLE`` statement will be generated in ``ext_tables.sql``.
12
14
* [FEATURE] XLF files are no longer rewritten when only the ``date=`` attribute changed — avoids VCS noise on every regeneration. The ``staticDateInXliffFiles`` setting is removed as it is no longer needed.
{relation.foreignKeyName} int unsigned DEFAULT '0' NOT NULL,</f:for><f:for each="{domainObject.properties}" as="property"><f:if condition="{property.isPersistable}">
0 commit comments