Sha256: 6953678d2167538352048d5c33ed68279b573a8f5f12ef70d50b5a47c1318b03

Contents?: true

Size: 1.02 KB

Versions: 19

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

class CreateDynamicImageVariants < ActiveRecord::Migration[5.2]
  def change
    create_table :dynamic_image_variants do |t|
      t.references :image, polymorphic: true, null: false

      # Dis attributes
      t.string  :content_hash, null: false
      t.string  :content_type, null: false
      t.integer :content_length, null: false
      t.string  :filename, null: false

      t.string :format, null: false
      t.integer :width, :height, null: false
      t.integer :crop_width, :crop_height, null: false
      t.integer :crop_start_x, :crop_start_y, null: false

      t.timestamps null: false
    end

    add_index(:dynamic_image_variants,
              %i[image_id image_type],
              name: "dynamic_image_variants_by_image")

    add_index(:dynamic_image_variants,
              %i[image_id image_type format width height crop_width
                 crop_height crop_start_x crop_start_y],
              name: "dynamic_image_variants_by_format_and_size",
              unique: true)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
dynamic_image-3.0.3 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.1.5 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-3.0.2 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-3.0.1 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-3.0.0 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.1.4 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.1.3 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.1.2 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.1.1 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.1.0 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.0.25 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.0.24 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.0.23 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.0.22 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.0.21 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.0.20 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.0.19 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.0.18 db/migrate/20190620160500_create_dynamic_image_variants.rb
dynamic_image-2.0.17 db/migrate/20190620160500_create_dynamic_image_variants.rb