dgraph-io / dgraph-io/dgraph

Migrations & version control

Open
#9,442 3 comments 0 reactions 1 assignee View on GitHub

@mangalaman93 is already working on this.

Since Jun 17, 2025.

Stale
Dominant language
Go
Stars
21.8k
Forks
1.6k
Avg merge
2d 5h
Merged PRs (30d)
9

Description

Dear DGraph Team,

I hope you're doing well! I’m excited to introduce dmigrate (https://github.com/vishenosik/dmigrate), a Golang library designed to manage schema versioning and migrations for DGraph databases.

Problem Addressed
DGraph currently lacks a built-in way to:

  1. Track and apply schema changes incrementally (like goose lib for SQL).
  2. Roll back schema changes safely.
  3. Maintain a versioned history of schema states.

dmigrate solves this by providing a simple, programmatic way to handle schema evolutions in a structured manner.
It's only version v0.0.1 in release and it only has Up migrations features.

Key Features
✅ Declarative Schema Migrations – Define schema changes in GQL files and apply them sequentially.
✅ Version Control – Track migrations with timestamps or incremental versions.
✅ Integration-Friendly – Works alongside existing DGraph clients.
✅ Minimal Dependencies – Lightweight, easy to embed in applications.

Future Features
🧪Safe Rollbacks – Optional down-migrations for reverting changes. (work in progress)
🧪Deletion Up Migrations - migrations able to delete schema elements.

Why This Library?

  1. Adoption Pain Point: Many teams manually manage DGraph schema changes, leading to drift and inconsistencies.
  2. DevOps/CI/CD Friendly: Enables automated schema updates in deployment pipelines.
  3. Complementary to DGraph: Could be an official/community-maintained tool.

I’d love your feedback on:

  1. Code Review – Could the DGraph team evaluate the library for potential improvements?
  2. Adoption – Would this fit as an official DGraph tool or community-supported project?
  3. Roadmap Alignment – Are there planned DGraph features that dmigrate should integrate with?

Looking forward to your thoughts!

Best regards,
[Nik]
[nikitakuznetcov618@gmail.com / github.com/vishenosik ]
[Repository: github.com/vishenosik/dmigrate]

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.