dbeatty10 / dbt-mysql

dbt-mysql contains all of the code enabling dbt to work with MySQL and MariaDB
Apache License 2.0
75 stars 53 forks source link

fix: snapshots failing because of wrong mysql colum quoting #171

Closed outinim closed 3 months ago

outinim commented 5 months ago

Description

When I do snapshots on a table on which i add columns: it use the function (if I read correctly the file dbt/include/mariadb/macros/materializations/snapshot/snapshot.sql) {% do create_columns(target_relation, missing_columns) %} which compiles into (for my source table users with a new column team) into alter tablesandbox.users_snapshotadd column "team" varchar(10); But it needs to be add column team to work in mysql

Checklist

outinim commented 5 months ago

Something like this is better ? Thanks for the reviews guys

mwallace582 commented 5 months ago

Sorry for the delay in taking a look at your changes. This is looking a lot better, and I've just got the one new comment.

It'd also be great if you'd be able to add some tests around this, although I'd be willing to merge this without them given the small scope of the changes.