Skip to content

Commit efecdda

Browse files
Split the Cypher cmd into two queries
1 parent 9166575 commit efecdda

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

modules/ROOT/pages/database-administration/standard-databases/create-databases.adoc

+9-5
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,18 @@ CREATE OR REPLACE DATABASE customers
207207
This is equivalent to running `DROP DATABASE customers IF EXISTS` followed by `CREATE DATABASE customers`.
208208

209209
Keep in mind that using `CREATE OR REPLACE DATABASE` also removes indexes and constraints.
210-
To preserve them, run the following Cypher command before the `CREATE OR REPLACE DATABASE` and save the output:
210+
To preserve them, run the following Cypher commands before the `CREATE OR REPLACE DATABASE` and save their outputs:
211211

212212
[source, cypher]
213213
----
214-
SHOW INDEXES YIELD createStatement
215-
UNION
216-
SHOW CONSTRAINTS YIELD createStatement
217-
RETURN createStatement as statement
214+
SHOW CONSTRAINTS YIELD createStatement AS statement
215+
----
216+
217+
[source, cypher]
218+
----
219+
SHOW INDEXES YIELD createStatement, owningConstraint
220+
WHERE owningConstraint IS NULL
221+
RETURN createStatement AS statement
218222
----
219223

220224
The behavior of `IF NOT EXISTS` and `OR REPLACE` apply to both standard and composite databases (e.g. a composite database may replace a standard database or another composite database).

0 commit comments

Comments
 (0)