thunderbird / thunderbird/thunderbird-android

Introduce foreign keys for database consistency

Open
#1,539 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Kotlin
Stars
14k
Forks
2.8k
Avg merge
3d 3h
Merged PRs (30d)
57

Description

At the moment, we don't use foreign keys for database consistency, but use triggers here and there to simulate ON DELETE CASCADE behavior. We should move to foreign keys at some point, and set PRAGMA foreign_keys = 1.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by locating the database schema, existing cascade triggers, and the code that opens the database; map the relationships that need foreign keys and determine how enabling PRAGMA foreign_keys = 1 affects them. Done means the relevant triggers are replaced safely and database consistency tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, sqlite
Domain
databases
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.