Class: CreateCkeditorAssets

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/ckeditor/templates/active_record/shrine/migration.rb,
lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb,
lib/generators/ckeditor/templates/active_record/paperclip/migration.rb,
lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb,
lib/generators/ckeditor/templates/active_record/active_storage/migration.rb

Instance Method Summary collapse

Instance Method Details

#downObject



22
23
24
# File 'lib/generators/ckeditor/templates/active_record/shrine/migration.rb', line 22

def down
  drop_table :ckeditor_assets
end

#upObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/ckeditor/templates/active_record/shrine/migration.rb', line 4

def up
  create_table :ckeditor_assets do |t|
    t.integer :data_size
    t.string  :type, limit: 30

    # Shrine column
    t.text    :attachment_data

    # Uncomment these to save image dimensions, if your need them.
    # t.integer :data_width
    # t.integer :data_height

    t.timestamps null: false
  end

  add_index :ckeditor_assets, :type
end