Sha256: e2c62c1adfefded2f730c9cac9dec087c7750761c8d51525659ab08bdb54d478

Contents?: true

Size: 1.38 KB

Versions: 26

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   "encodable_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   "encodable_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

26 entries across 26 versions & 1 rubygems

Version Path
phocoder-rails-0.0.58 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.57 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.56 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.55 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.54 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.53 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.52 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.51 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.50 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.49 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.48 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.47 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.46 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.45 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.44 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.43 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.42 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.41 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.40 lib/generators/phocoder_rails/templates/model_migration.rb
phocoder-rails-0.0.39 lib/generators/phocoder_rails/templates/model_migration.rb