Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1510 from psu-stewardship/mysql8
Browse files Browse the repository at this point in the history
fix migration for mysql 8
  • Loading branch information
carolyncole authored Jan 14, 2019
2 parents c55514b + 70f80f2 commit 536c786
Show file tree
Hide file tree
Showing 2 changed files with 336 additions and 323 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def change
remove_column :qa_local_authority_entries, :lower_label, :string

# You can remove this once we're all developing on MariaDB
if Rails.env.development? && Mysql2::Client.info.fetch(:version).match(/^5/)
if Rails.env.development? &&
(Mysql2::Client.info.fetch(:version).match(/^5/) ||
Mysql2::Client.info.fetch(:version).match(/^8/))
execute("alter table qa_local_authority_entries add lower_label varchar(256) GENERATED ALWAYS AS (lower(label)) VIRTUAL")
else
execute("alter table qa_local_authority_entries add lower_label varchar(175) GENERATED ALWAYS AS (lower(label)) persistent")
Expand Down
Loading

0 comments on commit 536c786

Please sign in to comment.