Use dbt to deploy changes to a liquibase table without dropping and recreating it

Hi @fabrice.etanchaud,

do you know if there is any support in dbt to deploy changes to a tables data model without dropping and re-creating the table? I would like to have an automated comparison of the table’s DLL in dbt with the existing table structure in the database that generates “alter table add / modify / drop column” statements.

Best regards,
Jens

Jens, hi.

You may want to use dummy dbt objects to have manual control over your legacy/unsupported/etc. underlying object.

" for example if we want to manage a DBT table with the name “not_supported_sql_server_temporal_table” we make an auxiliary DBT model “not_supported_sql_server_temporal_table_dbt” and do all the DML and DDL and other stuff in hooks, even SP and exec SP. In hooks correspondingly we use [{{this.schema}}].[{{this.table!replace(‘_dbt’,‘’)}}] reference. Despite having the overhead of having these dummy _dbt objects the approach delivers tremendous management relief in several areas. Previously we considered using SSDT/
redgate/flyway/liquibase as well"

https://getdbt.slack.com/archives/CMRMDDQ9W/p1614637447031700?thread_ts=1614637447.031700&cid=CMRMDDQ9W

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.