Skip to content

3.5.0.1871: trailing-newline regression + three apply-patch/validate inconsistencies (TZ fix verified) #2

@upsite4k

Description

@upsite4k

Summary

Followups from testing 3.5.0.1871 against a Laravel project (90 entities, 115 pre-existing migrations). The TZ-recompute fix from this release works as advertised. One trailing-newline issue still reproduces, plus three inconsistencies between -cli-apply-patch and -cli-validate worth fixing together.

1. UTC datetime fix — verified

<migrations timezone="…"> auto-populates on the first -cli-apply-patch (no GUI step required for headless use). With the exporting host's TZ matched to the original generator's, all 115 migration UTC comments are now byte-stable across servers.

2. Trailing newline on every exported migration — still reproduces on 1871

With #1 working, this is now the sole remaining byte difference between historical migration files and freshly-exported ones: a single appended LF.

on-disk  last 8 bytes :  \n  }  \n  }  \n
exported last 8 bytes :      }  \n  }  \n  \n

od -c of the trailing bytes from the same file before and after -cli-export:

on-disk  : } \n } \n
exported : } \n } \n \n

48,531 bytes on disk → 48,532 bytes after re-export. Reproduces on 115/115 migration files in this project. Happy to attach two files plus the .skipper project to a private channel if helpful.

3. add_index silently drops fields when passed a string instead of an array

// Both accepted with status:"ok" and ops_executed incremented;
// only the string form silently drops the field reference.
{"op":"add_index","args":{"entity":"Beruf","name":"kurz","fields":"beruf_kurz"}}     // → <index name="kurz" uuid="…"/> with no <index-field> children
{"op":"add_index","args":{"entity":"Beruf","name":"kurz","fields":["beruf_kurz"]}}   // → correct: <index-field name="beruf_kurz" …/>

The empty index produced by the string form exports as $table->index([], 'kurz'), which Laravel rejects at migrate time. Either accept the string as a single-element array, or reject with INVALID_OP — silent drop is the worst outcome.

4. -cli-validate doesn't flag <index> elements with zero <index-field> children

Closely related to #3, but independently fixable. An index with no field children passes validate (error_count: 0) and then breaks the export's migration. Suggest an INDEX_NO_COLUMNS (or similar) check.

5. add_field / update_field silently drop unsigned: true

{"op":"add_field","args":{"entity":"Beruf2","name":"ref_id","type":"bigInteger","unsigned":true}}

Result XML:

<field name="ref_id" type="bigInteger" required="true" uuid=""/>

No unsigned="true" attribute on the resulting field. The framework-template PK created by add_entity does carry unsigned="true", so the data model supports the attribute — it's the user-facing op that doesn't honor the arg.

6. -cli-apply-patch and -cli-validate disagree on the type vocabulary

{"op":"add_field","args":{"entity":"Beruf3","name":"ref_id","type":"unsignedBigInteger"}}

apply-patch accepts the op verbatim:

<field name="ref_id" type="unsignedBigInteger" required="true" uuid=""/>

-cli-validate on the resulting XML returns error_count: 1:

INVALID_FIELD_TYPE: Invalid field data type 'unsignedBigInteger' (object: \App\Models\Beruf3.ref_id)

Either apply-patch should reject unknown type strings, or both verbs should agree on what's valid.

Combined effect of #5 and #6: there's currently no -cli-apply-patch path to produce an unsigned non-PK bigInteger column. Workaround is to omit the column from the .skipper and add it via a hand-written follow-up Laravel migration outside the Skipper-generated set.

Environment

  • Build: 3.5.0.1871 Linux
  • Invocation: headless (QT_QPA_PLATFORM=offscreen, stdin closed)
  • Project: Laravel template, full license, project's <migrations> element now carries timezone="Europe/Berlin" (matches the historical generators)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions