Sha256: 2aefa944bac3f6cf9a037d8868fe11f21103e437a40577fa4135838de9c52bc7

Contents?: true

Size: 650 Bytes

Versions: 2

Compression:

Stored size: 650 Bytes

Contents

class CreateLolitaUploadFiles < ActiveRecord::Migration
  class << self
    
    def up
      create_table :lolita_files, :force=>true do |t|
        t.string  :asset
        t.string  :name
        t.string  :fileable_type
        t.integer :fileable_id
        t.string  :asset_extension, :limit=>12
        t.integer :asset_size
        t.timestamps
      end

      add_index :lolita_files, [:fileable_type,:fileable_id]
      add_index :lolita_files, :fileable_type
      add_index :lolita_files,:asset_size
      add_index :lolita_files, :created_at
    end

    def down
      drop_table :lolita_files
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lolita-file-upload-0.2.1 lib/generators/lolita_file_upload/templates/migration.rb
lolita-file-upload-0.2.0 lib/generators/lolita_file_upload/templates/migration.rb