Sha256: 68112f8f8fc3e5227896b964acfddd2d00306661786e2d84e47c15b9cfe427cb

Contents?: true

Size: 1.1 KB

Versions: 25

Compression:

Stored size: 1.1 KB

Contents

class CreateEffectiveAssets < ActiveRecord::Migration
  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.string  :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

25 entries across 25 versions & 1 rubygems

Version Path
effective_assets-1.6.4 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.6.3 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.6.2 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.6.1 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.6.0 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.9 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.8 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.7 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.6 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.5 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.4 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.3 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.2 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.1 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.5.0 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.4.9 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.4.8 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.4.7 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.4.6 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.4.5 db/migrate/01_create_effective_assets.rb.erb