MerginMaps / MerginMaps/geodiff

Support foreign keys during rebase

Open
#39 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
183
Forks
21
Avg merge
9d 11h
Merged PRs (30d)
2

Description

Currently if someone uses foreign keys between tables, things may not work correctly.

For example: table "tree_species" (with ID, latin name, common name columns) and table "trees" (with ID, location (X,Y), tree species ID). If two users both add a new tree species and a new tree:

  • user1: tree_species: new row with ID 5 named "abc"
  • user1: trees: new row with ID 10, referencing ID 5 of tree_species
  • user2: tree_species: new row with ID 5 named "def"
  • user2: trees: new row with ID 10, referencing ID 5 of tree_species

During rebase, tree_species of one user will be updated from ID 5 to 6, but the entry in trees table will still point to ID 5 (and does not get updated to ID 6).

For this, we should scan all foreign keys and make sure to update also update ID in other tables.

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

Start by tracing the rebase logic and how it resolves conflicting table IDs, then inspect how foreign-key relationships are exposed or discovered. Reproduce the tree_species and trees example and verify that when a referenced ID changes, corresponding IDs in other tables are updated consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.