Sha256: caf0af5379a51fd557ac1c072bbafad502872b82fbb77188c0485fd4fe72240f

Contents?: true

Size: 1.38 KB

Versions: 14

Compression:

Stored size: 1.38 KB

Contents

class Create<%= name.classify.pluralize %> < ActiveRecord::Migration
  def self.up
    
    create_table :<%= name.pluralize %> do |t|
      t.string   "filename"
      t.string   "content_type"
      t.integer  "duration_in_ms"
      t.integer  "width"
      t.integer  "height"
      t.integer  "file_size"
      t.string   "upload_host"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.datetime "taken_at"
      t.float    "lat"
      t.float    "lng"
      t.string   "cloudhdr_status"
      
      t.timestamps
    end
    
    add_index :<%= name.pluralize %>, :id
    
    
    create_table :<%= name.singularize %>_thumbnails do |t|
      t.string   "filename"
      t.string   "content_type"
      t.integer  "duration_in_ms"
      t.integer  "width"
      t.integer  "height"
      t.integer  "file_size"
      t.string   "upload_host"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.datetime "taken_at"
      t.float    "lat"
      t.float    "lng"
      t.string   "cloudhdr_status"
      
      t.string   "thumbnail"
      t.integer  "parent_id"
      t.string   "parent_type"
      
      t.timestamps
    end
    
    add_index :<%= name.singularize %>_thumbnails, :id
    add_index :<%= name.singularize %>_thumbnails, :parent_id
    
  end

  def self.down
    drop_table :<%= name.pluralize %>
    drop_table :<%= name.singularize %>_thumbnails
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
cloudhdr_rails-0.0.14 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.13 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.12 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.11 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.10 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.9 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.8 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.7 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.6 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.5 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.4 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.3 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.2 lib/generators/cloudhdr_rails/templates/model_migration.rb
cloudhdr_rails-0.0.1 lib/generators/cloudhdr_rails/templates/model_migration.rb