Sha256: 7f955e101d1917e6caca919d559cb2403dd8df410c24aa876abbdf37535d3e29
Contents?: true
Size: 1.04 KB
Versions: 11
Compression:
Stored size: 1.04 KB
Contents
class CreateOptionValueTranslations < ActiveRecord::Migration[6.1] def change if ActiveRecord::Base.connection.table_exists? 'spree_option_value_translations' # manually check for index since Rails if_exists does not always work correctly if ActiveRecord::Migration.connection.index_exists?(:spree_option_value_translations, :spree_option_value_id) remove_index :spree_option_value_translations, column: :spree_option_value_id, if_exists: true end else create_table :spree_option_value_translations do |t| # Translated attribute(s) t.string :name t.string :presentation t.string :locale, null: false t.references :spree_option_value, null: false, foreign_key: true, index: false t.timestamps end add_index :spree_option_value_translations, :locale, name: :index_spree_option_value_translations_on_locale end add_index :spree_option_value_translations, [:spree_option_value_id, :locale], name: :unique_option_value_id_per_locale, unique: true end end
Version data entries
11 entries across 11 versions & 1 rubygems