Sha256: c9654d2eb2783b43701fa5d14d450576b2d016f2a270a6fd12d1a0af698ececd

Contents?: true

Size: 799 Bytes

Versions: 8

Compression:

Stored size: 799 Bytes

Contents

class <%= migration_name %> < ActiveRecord::Migration
  def self.up
    create_table "assets" do |t|
      t.string   "data_file_name"
      t.string   "data_content_type"
      t.integer  "data_file_size"
      t.integer  "attachings_count", :default => 0
      t.datetime "created_at"
      t.datetime "data_updated_at"
    end
    
    create_table "attachings" do |t|
      t.integer  "attachable_id"
      t.integer  "asset_id"
      t.string   "attachable_type"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
    
    add_index "attachings", ["asset_id"], :name => "index_attachings_on_asset_id"
    add_index "attachings", ["attachable_id"], :name => "index_attachings_on_attachable_id"
  end
  
  def self.down
    drop_table :assets
    drop_table :attachings
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sga_paperclippolymorph-0.2.7 generators/polymorphic_paperclip/templates/migration.rb
sga_paperclippolymorph-0.2.6 generators/polymorphic_paperclip/templates/migration.rb
sga_paperclippolymorph-0.2.4 generators/polymorphic_paperclip/templates/migration.rb
sga_paperclippolymorph-0.2.3 generators/polymorphic_paperclip/templates/migration.rb
sga_paperclippolymorph-0.2.2 generators/polymorphic_paperclip/templates/migration.rb
sga_paperclippolymorph-0.2.1 generators/polymorphic_paperclip/templates/migration.rb
sga_paperclippolymorph-0.2.0 generators/polymorphic_paperclip/templates/migration.rb
sga_paperclippolymorph-0.1.0 generators/polymorphic_paperclip/templates/migration.rb