Class: CreateAvatars

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/authkit/templates/db/migrate/create_avatars.rb

Overview

Generated by Authkit.

Create an avatars table for managing user profile images

Class Method Summary collapse

Class Method Details

.downObject



24
25
26
# File 'lib/generators/authkit/templates/db/migrate/create_avatars.rb', line 24

def self.down
  drop_table :avatars
end

.upObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/authkit/templates/db/migrate/create_avatars.rb', line 6

def self.up
  create_table :avatars do |t|
    t.integer  :user_id
    t.integer  :top, default: 0
    t.integer  :left, default: 0
    t.integer  :width, default: 0
    t.integer  :height, default: 0
    t.text     :remote_url
    t.string   :attachment_file_name
    t.string   :attachment_content_type
    t.integer  :attachment_file_size
    t.datetime :attachment_updated_at
    t.boolean  :attachment_importing, default: false
    t.datetime :attachment_uploaded_at
    t.timestamps
  end
end