Commit 31438ddd authored by pjaspers's avatar pjaspers

Fix syntax coloring on emacs

The rather cryptic:

      "fk_#{Digest::SHA256.hexdigest("#{table}_#{column}_fk").first(10)}"

Was too much for emacs too handle*, since it was coming from the Rails
codebase I took their way of doing the same thing and applied it here.

I think it's easier to read and it also makes emacs render the
migration helpers pretty again.

* not true, emacs can handle anything, leave emacs alone!
parent 8716eb0c
......@@ -225,7 +225,10 @@ module Gitlab
# here is based on Rails' foreign_key_name() method, which unfortunately
# is private so we can't rely on it directly.
def concurrent_foreign_key_name(table, column)
"fk_#{Digest::SHA256.hexdigest("#{table}_#{column}_fk").first(10)}"
identifier = "#{table_name}_#{column}_fk"
hashed_identifier = Digest::SHA256.hexdigest(identifier).first(10)
"fk_#{hashed_identifier}"
end
# Long-running migrations may take more than the timeout allowed by
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment