Break up ALTER TABLE statements on crdb
That makes failures more granular.
@@ -336,6 +336,15 @@ impl SqlRenderer for PostgresFlavour {
return Vec::new();
}
+ if self.is_cockroachdb() {
+ let mut out = Vec::with_capacity(before_statements.len() + after_statements.len() + lines.len());
+ out.extend(before_statements.into_iter());
+ for line in lines {
+ out.push(format!("ALTER TABLE \"{}\" {}", tables.previous().name(), line))
+ }
+ out.extend(after_statements.into_iter());
+ out
+ } else {
let alter_table = format!(
"ALTER TABLE {} {}",
self.quote(tables.previous().name()),
@@ -348,6 +357,7 @@ impl SqlRenderer for PostgresFlavour {
.chain(after_statements.into_iter())
.collect()
}
+ }
fn render_create_enum(&self, enm: &EnumWalker<'_>) -> Vec<String> {
vec![ddl::CreateEnum {
