Sha256: 664c584fb5c21df3193bc9624fe3f2b61b86b961d5f86b7ace2b4f4dedf07623

Contents?: true

Size: 665 Bytes

Versions: 3

Compression:

Stored size: 665 Bytes

Contents

class CreateAttachyFilesTable < ActiveRecord::Migration[5.0]
  def change
    create_table :attachy_files do |t|
      t.integer :height       , null: false
      t.integer :width        , null: false
      t.string  :format       , null: false
      t.string  :public_id    , null: false
      t.string  :resource_type, null: false, default: :image
      t.string  :scope        , null: false
      t.string  :version      , null: false

      t.references :attachable, polymorphic: true

      t.timestamps null: false
    end

    add_index :attachy_files, [:attachable_type, :attachable_id, :scope], name: :index_attachy_files_on_attachable_and_scope
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
attachy-0.1.2 lib/generators/attachy/templates/db/migrate/create_attachy_files_table.rb
attachy-0.1.1 lib/generators/attachy/templates/db/migrate/create_attachy_files_table.rb
attachy-0.1.0 lib/generators/attachy/templates/db/migrate/create_attachy_files_table.rb