package com.salpa.subject.domain.diff.processor;


import com.salpa.subject.domain.data.ForeignKeyMeta;
import com.salpa.subject.domain.diff.data.FieldDiff;

import java.util.List;

public class ForeignKeyDiffProcessor implements DiffProcessor<ForeignKeyMeta> {

    @Override
    public FieldDiff process(String fieldName, List<ForeignKeyMeta> original, List<ForeignKeyMeta> current) {
        return diffTableField(
                original,
                current,
                "foreignKeys",
                fk -> fk.getFkTableName() + "." + fk.getFkColumnName() + "." + fk.getKeySeq());
    }
}
