Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.

Commit 2cc5a38

Browse files
Merge pull request #331 from Financial-Times/neo4j-v4
upgraded neo4j db and driver
2 parents 6196d70 + ecea9b1 commit 2cc5a38

File tree

15 files changed

+21
-22
lines changed

15 files changed

+21
-22
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ references:
1414
TERM: xterm
1515

1616
environment:
17-
NEO4J_VERSION: '3.5.0'
17+
NEO4J_VERSION: '4.1.6'
1818

1919
workspace_root: &workspace_root ~/
2020

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ node_modules/@financial-times/rel-engage/index.mk:
1717

1818
# End generated by rel-engage
1919
# ---------------------------
20-
LOCAL_BOLT_URL=bolt://localhost:7687
20+
LOCAL_BOLT_URL=neo4j://localhost:7687
2121
BIZ_OPS_BOLT_URL=${NEO4J_BOLT_URL}
22-
NEO4J_VERSION=3.5.0
22+
NEO4J_VERSION=4.1.6
2323
PRODUCT_NAME=biz-ops
2424
PROJECT_NAME=biz-ops-api
2525

@@ -100,6 +100,7 @@ run-test-db:
100100
wget -q dist.neo4j.org/neo4j-community-$(NEO4J_VERSION)-unix.tar.gz; \
101101
tar -xzf neo4j-community-$(NEO4J_VERSION)-unix.tar.gz -C neo4j --strip-components 1; \
102102
sed -i "s|#dbms.security.auth_enabled=false|dbms.security.auth_enabled=false|g" neo4j/conf/neo4j.conf;\
103+
cat neo4j/conf/neo4j.conf;\
103104
./scripts/neo4j-plugins; \
104105
dbms_memory_heap_initial_size="1024m" dbms_memory_heap_max_size="1024m" neo4j/bin/neo4j start; \
105106
./scripts/neo4j-wait-for-start;

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: '3'
22
services:
33
neo4j:
4-
image: neo4j:3.5.0
4+
image: neo4j:4.1.6
55
environment:
6-
- NEO4J_dbms_logs_query_enabled=true
6+
- NEO4J_dbms_logs_query_enabled=VERBOSE
77
- NEO4J_AUTH=none
88
- NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
99
- NEO4J_db_temporal_timezone=Z

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"http-errors": "^1.7.3",
1919
"lodash": "^4.17.18",
2020
"module-alias": "^2.2.2",
21-
"neo4j-driver": "^1.7.7",
21+
"neo4j-driver": "^4.1.2",
2222
"node-fetch": "^2.6.0",
2323
"react": "^16.12.0",
2424
"react-dom": "^16.12.0",

packages/tc-api-db-manager/db-connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const neo4j = require('neo4j-driver').v1;
1+
const neo4j = require('neo4j-driver');
22
const metrics = require('next-metrics');
33
const { logger } = require('@financial-times/tc-api-express-logger');
44

packages/tc-api-db-manager/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ const initConstraints = async () => {
2323
const retrieveConstraints = async () => {
2424
const constraints = await executeQuery('CALL db.constraints');
2525
return constraints.records.map(constraint =>
26-
constraint.get('description'),
26+
constraint.get('name'),
2727
);
2828
};
2929

3030
const retrieveIndexes = async () => {
3131
const indexes = await executeQuery('CALL db.indexes');
32-
return indexes.records.map(constraint =>
33-
constraint.get('description'),
34-
);
32+
return indexes.records.map(constraint => constraint.get('name'));
3533
};
3634

3735
const existingConstraints = await retrieveConstraints();

packages/tc-api-db-manager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"@financial-times/n-logger": "^6.1.0",
88
"@financial-times/tc-api-express-logger": "file:../tc-api-express-logger",
99
"@financial-times/tc-schema-sdk": "file:../tc-schema-sdk",
10-
"neo4j-driver": "^1.7.7",
10+
"neo4j-driver": "^4.1.2",
1111
"next-metrics": "^3.1.22"
1212
},
1313
"repository": {

packages/tc-api-rest-handlers/__tests__/patch-update.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const neo4jTemporalTypes = require('neo4j-driver/lib/v1/temporal-types');
1+
const neo4jTemporalTypes = require('neo4j-driver/lib/temporal-types');
22
const { setupMocks, neo4jTest } = require('../../../test-helpers');
33
const { dbUnavailable } = require('../../../test-helpers/error-stubs');
44
const { spyDbQuery } = require('../../../test-helpers/db-spies');

packages/tc-api-rest-handlers/lib/diff-properties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const neo4jTemporalTypes = require('neo4j-driver/lib/v1/temporal-types');
1+
const neo4jTemporalTypes = require('neo4j-driver/lib/temporal-types');
22
const { getType } = require('@financial-times/tc-schema-sdk');
33

44
const isNullValue = val => val === null || val === '';

packages/tc-api-rest-handlers/lib/neo4j-type-conversion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const {
22
isDateTime,
33
isDate,
44
isTime,
5-
} = require('neo4j-driver/lib/v1/temporal-types');
6-
const neo4jTemporalTypes = require('neo4j-driver/lib/v1/temporal-types');
5+
} = require('neo4j-driver/lib/temporal-types');
6+
const neo4jTemporalTypes = require('neo4j-driver/lib/temporal-types');
77
const { getType } = require('@financial-times/tc-schema-sdk');
88

99
const entriesToObject = (map, [key, val]) => Object.assign(map, { [key]: val });

0 commit comments

Comments
 (0)