use super::super::duplicate::Duplicate;
use super::super::Plan;
impl Plan {
pub(super) fn promote_shadows(&self) -> Vec<String> {
self.promotions
.iter()
.flat_map(|(table, column)| duplicate(table, column).promote())
.collect()
}
pub(super) fn discard_shadows(&self) -> Vec<String> {
self.promotions
.iter()
.map(|(table, column)| duplicate(table, column).discard())
.collect()
}
}
fn duplicate<'a>(table: &'a str, column: &'a str) -> Duplicate<'a> {
Duplicate {
table,
column,
column_type: None,
nullable: true,
default: None,
}
}