You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am not a very experienced programmer trying to use Neo4j with Rails and really enjoying it this far.
However, I’m having two problems with migrating:
Generated migrations for namespaces models doesn't work properly
The first problem is just annoying - when generating a new namespaces model, in the migration generated by the ActiveGraph generator the object name is not quoted in the symbol, causing the rake task to fail.
For example, rails generate model Documentations::DocuRev
Creates the following entry in the migrations file:
def up
add_constraint :Documentations::DocuRev, :uuid
end
Resulting in the following error when migrating
== 20210310115300 CreateDocumentation: running... ==============================
CYPHER CREATE CONSTRAINT ON (n:`Documentation`) ASSERT n.`uuid` IS UNIQUE
== 20210310115300 CreateDocumentation: migrated (0.1462s) ======================
== 20210310132055 CreateDocuRev: running... ====================================
rake aborted!
TypeError: :Documentations is not a class/module
The workaround is easy, just quote the object name:
def up
add_constraint :”Documentations::DocuRev,” :uuid
end
After migration, nothing can be saved to the database
The second problem is worse. After successfully migrating the database, trying to save something in the database results in the following error:
Hello,
I am not a very experienced programmer trying to use Neo4j with Rails and really enjoying it this far.
However, I’m having two problems with migrating:
Generated migrations for namespaces models doesn't work properly
The first problem is just annoying - when generating a new namespaces model, in the migration generated by the ActiveGraph generator the object name is not quoted in the symbol, causing the rake task to fail.
For example,
rails generate model Documentations::DocuRev
Creates the following entry in the migrations file:
Resulting in the following error when migrating
The workaround is easy, just quote the object name:
After migration, nothing can be saved to the database
The second problem is worse. After successfully migrating the database, trying to save something in the database results in the following error:
I managed to get around the problem by manually deleting and recreating all the constraints using the Neo4j Web Interface:
Runtime information:
Neo4j database version: 4.0.11
active-graph
gem version: 10.0.2neo4j-ruby-driver
gem version: 1.7.4Using Michael Simons seabolt driver (brew install michael-simons/homebrew-seabolt/seabolt)
The text was updated successfully, but these errors were encountered: