Sha256: 581bb1cd9891c56d3c651d20c47f3dfd459d5e012091e06f7458506f069e2fbc

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

class CreateSofaGallery < ActiveRecord::Migration
  def self.up 
    create_table :sofa_galleries do |t|
      t.string  :title
      t.string  :slug
      t.text    :description
      t.integer :full_width,    :null => false, :default => 600
      t.integer :full_height,   :null => false, :default => 450
      t.integer :thumb_width,   :null => false, :default => 200
      t.integer :thumb_height,  :null => false, :default => 150
      t.boolean :force_ratio,   :null => false, :default => true
      t.timestamps
    end
    add_index :sofa_galleries, :slug
    
    create_table :sofa_photos do |t|
      t.integer :gallery_id
      t.string  :title
      t.string  :slug
      t.text    :description
      t.string  :image_file_name
      t.string  :image_content_type
      t.integer :image_file_size
      t.integer :position, :null => false, :default => 0
      t.timestamps
    end
    add_index :sofa_photos, [ :gallery_id, :position ]
    add_index :sofa_photos, :slug
  end

  def self.down
    drop_table :sofa_photos
    drop_table :sofa_galleries
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sofa_gallery-0.0.0 db/migrate/01_create_sofa_gallery.rb