diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83a63b36a..918eff871 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -190,7 +190,7 @@ For Docker compose `up` or `build` commands, you can use our Apple M1 override f # for development $ docker compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.apple-m1.override.yml up -# only once: init admin user and create indexes and contraints in Neo4j database +# only once: init admin user and create indices and constraints in Neo4j database $ docker compose exec backend yarn prod:migrate init # clean db $ docker compose exec backend yarn db:reset @@ -199,7 +199,7 @@ $ docker compose exec backend yarn db:seed # for production $ docker compose -f docker-compose.yml -f docker-compose.apple-m1.override.yml up -# only once: init admin user and create indexes and contraints in Neo4j database +# only once: init admin user and create indices and constraints in Neo4j database $ docker compose exec backend /bin/sh -c "yarn prod:migrate init" ``` diff --git a/README.md b/README.md index f0688f820..5b36dbc87 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,7 @@ Prepare database once before you start by running the following command in a sec ```bash # in main folder while docker-compose is up $ docker-compose exec backend yarn run db:migrate init +$ docker-compose exec backend yarn run db:migrate up ``` Then clear and seed database by running the following command as well in the second terminal: diff --git a/deployment/DOCKER_MORE_CLOSELY.md b/deployment/DOCKER_MORE_CLOSELY.md index 113e3a4da..1768d74fa 100644 --- a/deployment/DOCKER_MORE_CLOSELY.md +++ b/deployment/DOCKER_MORE_CLOSELY.md @@ -24,7 +24,7 @@ $ docker compose -f docker-compose.yml -f docker-compose.apple-m1.override.yml u # for production testing Docker images from DockerHub $ docker compose -f docker-compose.ocelotsocial-branded.yml -f docker-compose.apple-m1.override.yml up -# only once: init admin user and create indexes and contraints in Neo4j database +# only once: init admin user and create indices and constraints in Neo4j database $ docker compose exec backend /bin/sh -c "yarn prod:migrate init" ``` diff --git a/neo4j/README.md b/neo4j/README.md index 885f7f445..a9834ae20 100644 --- a/neo4j/README.md +++ b/neo4j/README.md @@ -44,7 +44,7 @@ for development, spin up a [hosted Neo4j Sandbox instance](https://neo4j.com/download/), run Neo4j in one of the [many cloud options](https://neo4j.com/developer/guide-cloud-deployment/), [spin up Neo4j in a Docker container](https://neo4j.com/developer/docker/), -on Archlinux you can install [neo4j-community from AUR](https://aur.archlinux.org/packages/neo4j-community/) +on Arch linux you can install [neo4j-community from AUR](https://aur.archlinux.org/packages/neo4j-community/) or on Debian-based systems install [Neo4j from the Debian Repository](http://debian.neo4j.org/). Just be sure to update the Neo4j connection string and credentials accordingly in `backend/.env`. @@ -55,15 +55,15 @@ Start Neo4J and confirm the database is running at [http://localhost:7474](http: Here we describe some rarely used Cypher commands for Neo4j that are needed from time to time: -### Index And Contraint Commands +### Index And Constraint Commands -If indexes or constraints are missing or not set correctly, the browser search will not work or the database seed for development will not work. +If indices or constraints are missing or not set correctly, the browser search will not work or the database seed for development will not work. -The indexes and constraints of our database are set in `backend/src/db/migrate/store.js`. +The indices and constraints of our database are set in `backend/src/db/migrate/store.js`. This is where the magic happens. It's called by our `prod:migrate init` command. -This command initializes the Admin user and creates all necessary indexes and constraints in the Neo4j database. +This command initializes the Admin user and creates all necessary indices and constraints in the Neo4j database. ***Calls in development*** @@ -98,27 +98,27 @@ On a server with Kubernetes cluster: $ kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "yarn prod:migrate init" ``` -***Cypher commands to show indexes and constraints*** +***Cypher commands to show indices and constraints*** ```bash # in browser command line or cypher shell -# show all indexes and constraints +# show all indices and constraints $ :schema -# show all indexes +# show all indices $ CALL db.indexes(); # show all constraints $ CALL db.constraints(); ``` -***Cypher commands to create and drop indexes and constraints*** +***Cypher commands to create and drop indices and constraints*** ```bash # in browser command line or cypher shell -# create indexes +# create indices $ CALL db.index.fulltext.createNodeIndex("post_fulltext_search",["Post"],["title", "content"]); $ CALL db.index.fulltext.createNodeIndex("user_fulltext_search",["User"],["name", "slug"]); $ CALL db.index.fulltext.createNodeIndex("tag_fulltext_search",["Tag"],["id"]); @@ -126,6 +126,6 @@ $ CALL db.index.fulltext.createNodeIndex("tag_fulltext_search",["Tag"],["id"]); # drop an index $ DROP CONSTRAINT ON ( image:Image ) ASSERT image.url IS UNIQUE -# drop all indexes and constraints +# drop all indices and constraints $ CALL apoc.schema.assert({},{},true) YIELD label, key RETURN * ; ```