In order to have the twitter neo4j database more consistent we need to define some rules in the database which we could have them using a database migration. Here's the queries for migration
CREATE CONSTRAINT user_id_unique IF NOT EXISTS
FOR (a:TwitterAccount) REQUIRE a.userId IS UNIQUE;
CREATE CONSTRAINT tweet_id_unique IF NOT EXISTS
FOR (t:Tweet) REQUIRE t.tweetId IS UNIQUE;
CREATE CONSTRAINT hashtag_unique IF NOT EXISTS
FOR (h:Hashtag) REQUIRE h.hashtag IS UNIQUE;
In order to have the twitter neo4j database more consistent we need to define some rules in the database which we could have them using a database migration. Here's the queries for migration