This library makes alter table sql from 2 create table sql.
import com.geishatokyo.diffsql._
val builder = DiffSQLBuilder.createMySQLBuilder
val sqlDiff = builder.build()
val alterSqls = sqlDiff.diff(afterSql , beforeSql )
First you implement your com.geishatokyo.diffsql.diff.Differencer. Then you set it to builder.
import com.geishatokyo.diffsql._
val builder = DiffSQLBuilder.createMySQLBuilder
builder.differencer = new YourOriginalDifferencer()
val sqlDiff = builder.build()
val alterSqls = sqlDiff.diff(afterSql , beforeSql )
you implement your com.geishatokyo.diffsql.SQLnizer Then you set it to builder
import com.geishatokyo.diffsql._
val builder = DiffSQLBuilder.createMySQLBuilder
builder.sqlnizer = new YourOriginalSQLnizer()
val sqlDiff = builder.build()
val alterSqls = sqlDiff.diff(afterSql , beforeSql )
SQL(CreateTable,CreateIndex) -SQLParser-> AST -Aggregator-> -Normalizer-> -Differencer-> Diff -SQLnizer-> SQL(AlterTable)