mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Setup unique constraints on ids
This will * speed up data import from production * make sure we never have the same ids on certain labels
This commit is contained in:
parent
5771efc920
commit
13906c29aa
@ -4,13 +4,22 @@
|
||||
# the initial default user. Before we can create constraints, we have to change
|
||||
# the default password. This is a security feature of neo4j.
|
||||
if echo ":exit" | cypher-shell --password neo4j 2> /dev/null ; then
|
||||
echo "CALL dbms.security.changePassword('${NEO4J_PASSWORD}');" | cypher-shell --password neo4j
|
||||
neo4j-admin set-initial-password $NEO4J_PASSWORD
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
echo '
|
||||
CALL db.index.fulltext.createNodeIndex("full_text_search",["Post"],["title", "content"]);
|
||||
CREATE CONSTRAINT ON (p:Post) ASSERT p.id IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (c:Comment) ASSERT c.id IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (c:Category) ASSERT c.id IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:User) ASSERT u.id IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (o:Organization) ASSERT o.id IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (t:Tag) ASSERT t.id IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (c:Category) ASSERT c.id IS UNIQUE;
|
||||
|
||||
|
||||
CREATE CONSTRAINT ON (p:Post) ASSERT p.slug IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (c:Category) ASSERT c.slug IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:User) ASSERT u.slug IS UNIQUE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user