Sha256: 39288d0fa3f54371bf4dca9571362664ef17d120ec87a57163250772892f6fdc

Contents?: true

Size: 779 Bytes

Versions: 39

Compression:

Stored size: 779 Bytes

Contents

# frozen_string_literal: true

class CreateAlchemyIngredients < ActiveRecord::Migration[6.0]
  def change
    create_table :alchemy_ingredients do |t|
      t.references :element, null: false, foreign_key: { to_table: :alchemy_elements, on_delete: :cascade }
      t.string :type, index: true, null: false
      t.string :role, null: false
      t.text :value
      if ActiveRecord::Migration.connection.adapter_name.match?(/postgres/i)
        t.jsonb :data, default: {}
      else
        t.json :data
      end
      t.belongs_to :related_object, null: true, polymorphic: true, index: false
      t.index [:element_id, :role], unique: true
      t.index [:related_object_id, :related_object_type], name: "idx_alchemy_ingredient_relation"

      t.timestamps
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.9 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.8 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.7 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.6 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.5 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.0.14 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.4 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.0.13 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.3 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.2 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.1 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.1.0 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.0.12 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.0.11 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.0.10 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.0.9 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.0.8 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.0.7 db/migrate/20210508091432_create_alchemy_ingredients.rb
alchemy_cms-6.0.6 db/migrate/20210508091432_create_alchemy_ingredients.rb