Sha256: 46cd00b43f25b2fd2455ba9b6f0a9bbf37ecc01890ec0dd50bfcd8fb2aee2187

Contents?: true

Size: 871 Bytes

Versions: 7

Compression:

Stored size: 871 Bytes

Contents

class <%= migration_name %> < ActiveRecord::Migration
  def self.up
    create_table :papermill_assets do |t|
    
      # Paperclip fields (required)
      t.string   :file_file_name
      t.string   :file_content_type
      t.integer  :file_file_size
      
      # Papermill fields (required)
      t.integer  :position          # sets are ordered by position
      t.integer  :assetable_id      # Assetable
      t.string   :assetable_type    # Assetable
      t.string   :assetable_key     # Assetable sets
      t.string   :type              # STI
      t.string   :title             # raw filename, without file extension, for your own use
      
      # Custom fields (optionnals)
      t.string   :alt
      t.string   :copyright
      t.text     :description
      t.timestamps
      
    end
  end
  
  def self.down
    drop_table :papermill_assets
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
papermill-1.1.0 generators/papermill_table/templates/migrate/papermill_migration.rb.erb
papermill-1.0.7 generators/papermill_table/templates/migrate/papermill_migration.rb.erb
papermill-1.0.6 generators/papermill_table/templates/migrate/papermill_migration.rb.erb
papermill-1.0.5 generators/papermill_table/templates/migrate/papermill_migration.rb.erb
papermill-1.0.4 generators/papermill_table/templates/migrate/papermill_migration.rb.erb
papermill-1.0.3 generators/papermill_table/templates/migrate/papermill_migration.rb.erb
papermill-1.0.2 generators/papermill_table/templates/migrate/papermill_migration.rb.erb