Neo4j Schema Migrations?

Viewed 1487

So I am using Neo4J and thought about how to update existing databases with schema changes e.g. a Node has new properties, edges changed, values changed, etc.

So far I was only using SQL Server and the Entity Framework includes a migration tool that can automatically write migrations when the schema changes.

How is this done in Neo4J? E.g. a customer has v. 1.0 from our software and neo4j database. We make changes for v.1.1 and now we need to update the db from all our customers.

I am using Neo4J in C#. I have so far only found something similar for Ruby: https://neo4jrb.readthedocs.io/en/8.2.x/Migrations.html

3 Answers

Since neo4j is basically "schema-less" (in the relational DB sense), there is no tool for migrating to a new neo4j "schema".

You will have to write code to update the DB.

I do actively maintain Neo4j-Migrations:

https://github.com/michael-simons/neo4j-migrations

It's basically an automated script runner, that stores schema versions inside the same database as a subgraph. It is also able to store them separately in a Neo4j server supporting multi databases.

As you mention that you are using C#: This tool is Java based, but I do also provide native binaries for all 3 major OSses availabe on GitHub. You might can integrate them into your workflow.

Related