Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,17 @@ CREATE OR REPLACE DATABASE customers

This is equivalent to running `DROP DATABASE customers IF EXISTS` followed by `CREATE DATABASE customers`.

Keep in mind that by running `CREATE OR REPLACE DATABASE` you delete also indexes and constraints.
If you wish to preserve them, run the following Cypher command before the `CREATE OR REPLACE DATABASE` and save the output:

[source, cypher]
----
SHOW INDEXES YIELD createStatement
UNION
SHOW CONSTRAINTS YIELD createStatement
RETURN createStatement as statement
----

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).

[NOTE]
Expand Down