Skip to content

Migrations & version control #9442

@vishenosik

Description

@vishenosik

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]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions