liquibase / liquibase

Main Liquibase Source
https://www.liquibase.org
Apache License 2.0
4.55k stars 1.82k forks source link

Diff Schema between different DB engines #3188

Open fengcai123 opened 1 year ago

fengcai123 commented 1 year ago

Environment

Liquibase Version: 4.15.0

Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.> CLI

Liquibase Extension(s) & Version:

Database Vendor & Version: Varies

Operating System Type & Version: Linux

Infrastructure Type/Provider: <AWC, GCS, Azure, VM, etc> AWS

Description: Feature Request

When moving database into cloud, a lot of people choose migrating database into open source engine (PostgeSQL as the most popular choice) If would be nice if Liquibase can diff schemas between different engine. Starting source as Oracle/Sql Server/DB2 and target as PostgreSQL. It does not have to be full feature as data type is different between DBMS. Something like all tables/columns/indexes are there, case insensitive diff would be welcome (PostgrSQL schema is lower case while other DB is upper case).

kataggart commented 1 year ago

@fengcai123 Thanks for writing this up. Are there other specific "tuning" settings you'd like to be able to adjust when using Diff between two databases? Things that are showing up now as different than in this use case should be considered SAME?

kataggart commented 1 year ago

noting original forum post https://forum.liquibase.org/t/diff-between-db-engine/7222

fengcai123 commented 1 year ago

Hi, thanks for quick response. Personally I like to start with few options:

  1. case insensitive
  2. Data type mapping. There some some well known rule for data type mapping. Oracle NUMBER->PostgreSQL numeric etc. To make it flexible, I am thinking a data type mapping file which user can update.