Skip to content

Commit a5db63b

Browse files
authored
fix index with columns containing spaces
if columns contains space then index name built from the name contains space as well. Fixed with space replaced to underscore.
1 parent d25c300 commit a5db63b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dbt/include/sqlserver/macros/indexes.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ end
132132

133133
{{ log("Creating nonclustered index...") }}
134134

135-
{% set idx_name = this.table + '__index_on_' + columns|join('_') %}
135+
{% set idx_name = this.table + '__index_on_' + columns|join('_')|replace(" ", "_") %}
136136

137137
if not exists(select * from sys.indexes
138138
where

0 commit comments

Comments
 (0)