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

Commit

Permalink
fix migration for mysql 8
Browse files Browse the repository at this point in the history
  • Loading branch information
carolyncole committed Jan 7, 2019
1 parent 411d095 commit 70f80f2
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 70f80f2

Please sign in to comment.