Skip to content

Fix MySQL connections + remove type CHECK constraint#5

Merged
matej21 merged 4 commits intomainfrom
fix/drop-connection-type-constraint
Apr 2, 2026
Merged

Fix MySQL connections + remove type CHECK constraint#5
matej21 merged 4 commits intomainfrom
fix/drop-connection-type-constraint

Conversation

@matej21
Copy link
Copy Markdown
Member

@matej21 matej21 commented Apr 1, 2026

Summary

  • Includes all changes from Fix MySQL connections crashing server mode #4 (fix MySQL connections crashing server mode)
  • Additionally removes the CHECK(type IN (...)) constraint from the connections table entirely — both in migration 1 (fresh DBs) and migration 9 (existing DBs)
  • Connection type is already validated at the application level (TypeScript types + driver registry), so the DB-level constraint is redundant and causes painful table-recreation migrations every time a new database type is added

Test plan

  • bun test tests/app-db.test.ts — all 90 tests pass
  • Migration 9 upgrade path test verifies zero data loss during table recreation

🤖 Generated with Claude Code

soukicz and others added 4 commits April 1, 2026 13:38
The connections table CHECK constraint only allowed 'postgresql' and
'sqlite', crashing the server when storing MySQL connections. Add 'mysql'
to migration 1 for fresh databases and add migration 9 to recreate the
table for existing installations. The migration runner now supports a
disableForeignKeys flag to safely handle table recreation without
cascade-deleting child table data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The connection type is already validated at the application level
(TypeScript types + driver registry). The DB-level CHECK constraint
only causes painful table-recreation migrations every time a new
database type is added.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The lockfile was out of sync with package.json since 4e9a5cf removed
electron dependencies without regenerating it, causing CI to fail
with --frozen-lockfile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Run dprint fmt to fix markdown table alignment and long lines
in app-db tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matej21 matej21 merged commit 06cba78 into main Apr 2, 2026
1 check 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