Sha256: c5c462298fd045a53b7b5327e3b1ca75e8732604441135900a9863280d2424ed

Contents?: true

Size: 880 Bytes

Versions: 3

Compression:

Stored size: 880 Bytes

Contents

class CreateRedactorAssets < ActiveRecord::Migration
  def change
    create_table :redactor_assets do |t|
      t.string   :data_file_name, null: false
      t.string   :data_content_type
      t.integer  :data_file_size
      t.datetime :data_updated_at

      t.integer :assetable_id
      t.string  :assetable_type, limit: 30
      t.string  :type, limit: 30

      # Uncomment	it to save images dimensions, if your need it
      t.integer :width
      t.integer :height

      t.timestamps
    end

    # Uncomment it to add foreign key. gem 'foreigner' is required in your .Gemfile
    # add_foreign_key(:redactor_assets, :users, dependent: :delete)
    add_index "redactor_assets", ["assetable_type", "type", "assetable_id"], name: "idx_redactor_assetable_type"
    add_index "redactor_assets", ["assetable_type", "assetable_id"], name: "idx_redactor_assetable"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
redactor-rails-paperclip-0.4.3 lib/generators/redactor/templates/active_record/paperclip/migration.rb
redactor-rails-paperclip-0.4.2.1 lib/generators/redactor/templates/active_record/paperclip/migration.rb
redactor-rails-paperclip-0.4.1 lib/generators/redactor/templates/active_record/paperclip/migration.rb