#[derive(Debug, Clone)]
pub struct IndexDef {
pub columns: Vec<String>,
pub unique: bool,
pub name: Option<String>,
}
impl IndexDef {
pub fn new(columns: Vec<impl Into<String>>) -> Self {
Self {
columns: columns.into_iter().map(|c| c.into()).collect(),
unique: false,
name: None,
}
}
pub fn unique(mut self) -> Self {
self.unique = true;
self
}
pub fn name(mut self, name: impl Into<String>) -> Self {
self.name = Some(name.into());
self
}
}