Class: CreateAvatars

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/project/db/migrate/21_create_avatars.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/project/db/migrate/21_create_avatars.rb', line 2

def change
  create_table :avatars do |t|
    t.references :imageable, polymorphic: true, index: true
    t.attachment :uploaded_file
    t.integer :imageable_id, unsigned: true, index: true, limit: 3
    t.string :imageable_type, index: true

    t.timestamps null: false
  end
end