Sha256: f92ecb8b41c138a0eee5ccf3ca8b7e1568b16ce6801f987b88c8dbf7cd7241d9

Contents?: true

Size: 1.11 KB

Versions: 9

Compression:

Stored size: 1.11 KB

Contents

class CreateEffectiveAssets < ActiveRecord::Migration[4.2]
  def self.up
    create_table <%= @assets_table_name %> do |t|
      t.string  :title
      t.text    :extra

      t.integer :user_id

      t.string  :content_type
      t.text    :upload_file
      t.string  :data
      t.boolean :processed, :default => false
      t.string  :aws_acl, :default => 'public-read'

      t.integer :data_size
      t.integer :height
      t.integer :width
      t.text    :versions_info

      t.timestamps
    end

    add_index <%= @assets_table_name %>, :content_type
    add_index <%= @assets_table_name %>, :user_id

    create_table <%= @attachments_table_name %> do |t|
      t.integer :asset_id
      t.string  :attachable_type
      t.integer :attachable_id
      t.integer :position
      t.string  :box
    end

    add_index <%= @attachments_table_name %>, :asset_id
    add_index <%= @attachments_table_name %>, [:attachable_type, :attachable_id]
    add_index <%= @attachments_table_name %>, :attachable_id
  end

  def self.down
    drop_table <%= @assets_table_name %>
    drop_table <%= @attachments_table_name %>
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
effective_assets-1.10.1 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.10.0 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.9.14 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.9.13 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.9.12 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.9.11 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.9.10 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.9.9 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.9.8 db/migrate/01_create_effective_assets.rb.erb