hasura / hasura/graphql-engine

Repeatable or Automatic Dependent Child Migrations

Open
#10,129 0 comments 0 reactions 0 assignees View on GitHub
k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Problem

Often times there are database objects (views, functions, etc) that are dependent on others. Migrating a parent means having to manually drop and update all children. This is a very tedious process fraught with potential to make major mistakes.

### Solution

Something like Red Gate's [Repeatable Migrations](https://documentation.red-gate.com/fd/migrations-184127470.html#Migrations-RepeatableMigrations) would get us half way there. But what would be really cool is a system that automatically checks for dependent objects (by querying the object's [metadata](https://stackoverflow.com/questions/4462908/find-dependent-objects-for-a-table-or-view)), copies them into subsequent migrations and then adds the drops in front of the parent migrations. If not automated, at least some kind of walk-through in the Hasura UI that copies the dependent objects into new migration files (in the correct order) which can then be manually edited as needed.

### Describe alternatives you've considered

Right now, it's all manual...

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. First clarify whether the goal is automatic dependency discovery and migration ordering, or a Hasura UI walkthrough; done should mean dependent database objects can be handled in the correct order without the current fully manual process.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgres
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.