sea-schema-sync 0.17.0-rc.16

🌿 SQL schema definition and discovery
Documentation
use super::{IndexInfo, TableDef};

#[derive(Debug, Clone, PartialEq)]
pub struct Schema {
    pub tables: Vec<TableDef>,
    pub indexes: Vec<IndexInfo>,
}

impl Schema {
    pub fn merge_indexes_into_table(mut self) -> Self {
        for table in self.tables.iter_mut() {
            for index in self.indexes.iter() {
                if index.table_name == table.name {
                    table.constraints.push(index.clone());
                }
            }
        }
        self
    }
}