diff --git a/NEWS.md b/NEWS.md index ad4edeb782fd..47b67931fb3d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,7 @@ Development - None yet ### Features +* Fix column sanitization for connector syncs ([15885](https://github.com/CartoDB/cartodb/pull/15885)) * Load config files as ERB templates to allow reading ENV values ([15881](https://github.com/CartoDB/cartodb/pull/15881)) ### Bug fixes / enhancements diff --git a/app/models/synchronization/adapter.rb b/app/models/synchronization/adapter.rb index 5ee4575da00e..9df6fc731b59 100644 --- a/app/models/synchronization/adapter.rb +++ b/app/models/synchronization/adapter.rb @@ -268,8 +268,7 @@ def import_cleanup(schema_name, table_name) # but is kept because there may be existing syncs for which this double sanitization # (version 1 sanitization which wasn't idemponent) had the effect of altering some # satinizated names (e.g. __1 -> _1). - table = ::Table.new(name: @table_name, user_id: @user.id) - # we could as well: table = Carto::UserTable.find(@user.tables.where(name: @table_name).first.id).service + table = Carto::UserTable.find(@user.tables.where(name: @table_name).first.id).service table.sanitize_columns(table_name: table_name, database_schema: schema_name, connection: user_database) # When tables are created using ogr2ogr they are added a ogc_fid or gid primary key