Skip to content

fix(invoices): store time_entry_ids as text - #867

Merged
evilguy4000 merged 2 commits into
DRYTRIX:developfrom
jayhemnani9910:fix/invoice-item-time-entry-ids-text
Nov 10, 2026
Merged

evilguy4000 merged 2 commits into
DRYTRIX:developfrom
jayhemnani9910:fix/invoice-item-time-entry-ids-text

Conversation

@jayhemnani9910

Copy link
Copy Markdown
Contributor

Description

Generating an invoice from about 100 or more time entries returned a 500 on PostgreSQL: value too long for type character varying(500). A grouped line stores every entry id joined with commas in invoice_items.time_entry_ids, and grouped is the default. SQLite doesn't enforce the length, so only PostgreSQL deployments hit it.

The column is now Text, with a migration.

On PostgreSQL 16, an invoice from 160 entries returned 500 before, and after changing the column it created the grouped line. flask db upgrade and downgrade both run on the new migration.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would change existing behavior)
  • Documentation update
  • Refactor (no functional change)

Checklist

  • My code follows the project's style guidelines (Black, flake8).
  • I have added/updated tests for my changes. (The test database is SQLite, which doesn't enforce the length, so a test wouldn't fail without the change.)
  • All tests pass locally (e.g. pytest). (Not run in full, too heavy for this laptop.)
  • I have updated the documentation if needed.
  • For user-facing changes, I have added an entry to the Unreleased section of CHANGELOG.md.

jayhemnani9910 and others added 2 commits November 10, 2026 03:21
A grouped invoice line joins every entry id, so about 100 entries
overflowed VARCHAR(500) and generation failed on PostgreSQL.
@evilguy4000
evilguy4000 merged commit 82561e3 into DRYTRIX:develop Nov 10, 2026
5 checks passed
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.

2 participants