Skip to content

Commit

Permalink
Merge pull request #37 from vendrinc/disable-triggers-when-cloning
Browse files Browse the repository at this point in the history
Disable triggers to allow cloning when invalid FKs
  • Loading branch information
why-el authored Sep 28, 2023
2 parents ea78007 + 33605c8 commit 99ebd2f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ fn main() -> Result<(), Box<dyn Error>> {
pb.finish_with_message(format!("Total size estimated at: {total_size} kiB"));
} else {
let mut sizes: Vec<(String, u64)> = Vec::with_capacity(tables.len());
// Disable triggers and FK constraint checks.
writeln!(std::io::stdout(), "SET session_replication_role = replica;")?;

// Truncate tables first. There can be foreign key relationships between
// tables so either we need to truncate all tables now or we need to
Expand Down

0 comments on commit 99ebd2f

Please sign in to comment.