update migrations

This commit is contained in:
Albert Yi
2018-11-28 13:30:35 -08:00
parent f7b9417005
commit 2cc86877b1
3 changed files with 3 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
class ChangeDescendantNamesToArrayOnTagImplications < ActiveRecord::Migration[5.2]
def up
TagImplication.without_timeout do
change_column_default :tag_implications, :descendant_names, from: '', to: false
change_column :tag_implications, :descendant_names, "text[]", using: "string_to_array(descendant_names, ' ')::text[]", default: "{}"
end
end

View File

@@ -1,6 +1,7 @@
class ChangeStringsToArraysOnArtistVersions < ActiveRecord::Migration[5.2]
def up
ArtistVersion.without_timeout do
change_column_default :artist_versions, :other_names, from: '', to: false
change_column :artist_versions, :other_names, "text[]", using: "array_remove(regexp_split_to_array(other_names, '\\s+'), '')", default: "{}"
change_column :artist_versions, :url_string, "text[]", using: "array_remove(regexp_split_to_array(url_string, '\\s+'), '')", default: "{}"

View File

@@ -1,6 +1,7 @@
class ChangeOtherNamesToArrayOnArtists < ActiveRecord::Migration[5.2]
def up
Artist.without_timeout do
change_column_default :artists, :other_names, from: '', to: false
remove_index :artists, name: "index_artists_on_other_names_trgm"
change_column :artists, :other_names, "text[]", using: "array_remove(regexp_split_to_array(other_names, '\\s+'), '')", default: "{}"
add_index :artists, :other_names, using: :gin