Skip to content

Commit

Permalink
Fix issue with default view value not being found because of case sen…
Browse files Browse the repository at this point in the history
…sitivity
  • Loading branch information
aidanharan committed Oct 10, 2023
1 parent 5b720b6 commit 0be80a6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def column_definitions(table_name)

if view_exists
results = sp_executesql %{
SELECT c.COLUMN_NAME AS [name], c.COLUMN_DEFAULT AS [default]
SELECT LOWER(c.COLUMN_NAME) AS [name], c.COLUMN_DEFAULT AS [default]
FROM #{database}.INFORMATION_SCHEMA.COLUMNS c
WHERE c.TABLE_NAME = #{quote(view_tblnm)}
}.squish, "SCHEMA", []
Expand Down Expand Up @@ -426,7 +426,7 @@ def column_definitions(table_name)
ci[:default_function] = begin
default = ci[:default_value]
if default.nil? && view_exists
view_column = views_real_column_name(table_name, ci[:name])
view_column = views_real_column_name(table_name, ci[:name]).downcase
default = default_functions[view_column] if view_column.present?
end
case default
Expand Down

0 comments on commit 0be80a6

Please sign in to comment.