Files
alpenwerk-hr/scripts
Maximilian Stubhan 4ac516daa1
Some checks failed
CI / Lint, Typen, Tests, Build (push) Successful in 11m6s
CI / Migrationen auf leerer Datenbank (push) Failing after 5m24s
Read the whole ALTER TABLE, not just its first clause
The schema/type drift check has been red in CI. It reported seven
discrepancies, and all seven were the checker's own fault.

The migrations put several clauses in one statement:

  alter table employees
    drop column if exists division_id,
    drop column if exists team_id,
    drop column if exists manager_id,
    drop column if exists org_level,
    drop column if exists is_lead;

The old pattern matched `alter table (\w+)\s+drop column (\w+)` as a single
regex, which finds exactly the first clause. So division_id was dropped from
the model and the other four stayed in it — the checker insisted four columns
existed that the OM cutover removed a year ago. The same cut the other way for
`add column`: kuendigungsschutz_bis, teilzeit_bis and aufenthaltstitel_bis are
each the second clause of their statement, so the checker never saw them and
called them typed-but-absent.

Now the statement is collected up to its terminating semicolon — with paren
depth tracked, so a semicolon inside a check constraint does not end it early
— and every clause inside is applied.

Verified by mutation, not by the green result alone: putting an invented
column into types.ts is caught, and reverting the parser to read only the
first clause brings back exactly those seven messages. That is the diagnosis
confirmed, not merely a passing run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 10:53:57 +02:00
..
2026-09-07 10:43:22 +02:00
2026-09-07 10:43:22 +02:00