← All projects

SchemaSync

Compares two database schemas and generates the migration script between them. Built at HackUPC 2026.

Problem

Schema reconciliation between two databases (M&A, platform migrations, data consolidation) is normally days of senior-engineer work. HackUPC 2026 project to see if we could automate it into seconds.

Role

Team project at HackUPC 2026. Extended it after the hackathon.

How it works

FastAPI backend in backend/main.py with a three-layer reconciliation pipeline in core/reconciliation/engine.py. Layer one (analysis/structural.py) fingerprints each schema by primary-key strategy, foreign-key density, column-type distribution, junction table detection, and audit-column presence, then scores by cosine similarity. Layer two (analysis/semantic.py) runs 14-category synonym dictionaries plus Jaccard tokenization plus a hybrid score (50% semantic, 30% name, 20% core name), with optional sentence-transformers embeddings and a CMS pattern boost. Layer three (reconciliation/assignment.py) uses SciPy's linear_sum_assignment (Hungarian) for globally optimal bipartite matching.

Multi-format parsers under core/parsers/ for SQL DDL, Prisma, and JSON Schema. Conflict detector emits seven types. codegen/generator.py emits five migration formats (Generic SQL, Flyway, Liquibase XML, AWS DMS JSON, Rollback) with MySQL and PostgreSQL dialect adapters and safe conversions (NULLIF, STR_TO_DATE, CASE). Frontend is React 18 + TypeScript + Vite with 67 components and 53 hooks.

Stack
Python FastAPI SciPy sentence-transformers React 18 TypeScript Vite TanStack Query ReactFlow Tailwind Docker HackUPC 2026
Result

Production-ready per README's April 2026 status. Docker Compose with health checks, six built-in demo schema pairs (Ghost, WordPress, CRM legacy/modern, messy pairs), zero TypeScript errors on the production build. MIT.