Sha256: 63628cae74aad6e0a3f41ae5b7907e39d812364a581a5c1f83412e89599349a7

Contents?: true

Size: 1.15 KB

Versions: 12

Compression:

Stored size: 1.15 KB

Contents

class CreateEffectiveAssets < ActiveRecord::Migration
  def self.up
    create_table <%= @assets_table_name %> do |t|
      t.string  :title
      t.text    :description
      t.string  :tags
      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

12 entries across 12 versions & 1 rubygems

Version Path
effective_assets-1.3.2 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.3.1 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.3.0 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.2.5 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.2.4 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.2.3 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.2.2 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.2.0 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.1.2 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.1.1 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.1.0 db/migrate/01_create_effective_assets.rb.erb
effective_assets-1.0.0 db/migrate/01_create_effective_assets.rb.erb