Skip to content

Commit 3538735

Browse files
authored
feat(destination): add ability to disable schema wipe (#148)
1 parent b3239af commit 3538735

4 files changed

Lines changed: 6 additions & 1 deletion

File tree

examples/replibyte.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ source:
1111
transformer_name: random # TO CHANGE
1212
destination:
1313
connection_uri: $DESTINATION_CONNECTION_URI
14+
# Wipe the public schema
15+
# wipe_database: false (default: true)
1416
datastore:
1517
aws:
1618
bucket: $S3_BUCKET

replibyte/src/commands/dump.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ where
435435
database.as_str(),
436436
username.as_str(),
437437
password.as_str(),
438-
true,
438+
destination.wipe_database.unwrap_or(true),
439439
);
440440

441441
let task = FullRestoreTask::new(&mut postgres, datastore, options);

replibyte/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ impl SourceConfig {
223223
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
224224
pub struct DestinationConfig {
225225
pub connection_uri: String,
226+
pub wipe_database: Option<bool>
226227
}
227228

228229
impl DestinationConfig {

website/docs/guides/2-restore-a-dump.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ To restore on a remote database, you need to specify the destination connection
8080
```yaml title="conf.yaml"
8181
destination:
8282
connection_uri: postgres://user:password@host:port/db
83+
# Disable public's schema wipe
84+
# wipe_database: false (default: true)
8385
```
8486

8587
and run the following command:

0 commit comments

Comments
 (0)