You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: modules/ROOT/pages/database-administration/standard-databases/create-databases.adoc
+9-5
Original file line number
Diff line number
Diff line change
@@ -207,14 +207,18 @@ CREATE OR REPLACE DATABASE customers
207
207
This is equivalent to running `DROP DATABASE customers IF EXISTS` followed by `CREATE DATABASE customers`.
208
208
209
209
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:
211
211
212
212
[source, cypher]
213
213
----
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
218
222
----
219
223
220
224
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