devise-activegraph icon indicating copy to clipboard operation
devise-activegraph copied to clipboard

Generates two migrations with the same timestamp

Open leehericks opened this issue 6 years ago • 2 comments

New example Rails 5.1.4 project, gems:

# Secure ALL the things!
gem 'devise'
gem 'neo4j', '~> 8.2.1'
gem 'devise-neo4j'

rails g neo4j:devise User generates: 20170910050708_create_user 20170910050708_devise_create_user_constraints_and_indexes

Running rails neo4j:migrate results in:

== 20170910050708 CreateUser: running... =======================================
 CYPHER CREATE CONSTRAINT ON (n:`User`) ASSERT n.`uuid` IS UNIQUE
== 20170910050708 CreateUser: migrated (0.0831s) ===============================

== 20170910050708 DeviseCreateUserConstraintsAndIndexes: running... ============
rails aborted!
Neo4j::Core::CypherSession::SchemaErrors::ConstraintValidationFailedError:   Cypher error:
  Neo.ClientError.Schema.ConstraintValidationFailed: Node(0) already exists with label `Neo4j::Migrations::SchemaMigration` and
property `migration_id` = '20170910050708'

/Users/leehericks/Developer/tests/neo4j_devise_test/bin/rails:9:in `require'
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/rails:9:in `<top (required)>'
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'

Then I renamed to: 20170910050708_create_user 20170910050709_devise_create_user_constraints_and_indexes

Running rails neo4j:migrate results in:

== 20170910050708 CreateUser: running... =======================================
 CYPHER CREATE CONSTRAINT ON (n:`User`) ASSERT n.`uuid` IS UNIQUE
== 20170910050708 CreateUser: migrated (0.0661s) ===============================

== 20170910050709 DeviseCreateUserConstraintsAndIndexes: running... ============
rails aborted!
NotImplementedError: NotImplementedError
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/rails:9:in `require'
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/rails:9:in `<top (required)>'
/Users/leehericks/Developer/tests/neo4j_devise_test/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'

Not sure what's happening there...

leehericks avatar Sep 10 '17 05:09 leehericks