Sha256: 5b440780b46ee110cf00a5a25b16ea9a67de925245a26e03c9be63212c37399d

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

class CreateComfyGallery < ActiveRecord::Migration
  def self.up 
    create_table :gallery_galleries do |t|
      t.string  :title
      t.string  :slug
      t.text    :description
      t.integer :full_width,          :null => false, :default => 640
      t.integer :full_height,         :null => false, :default => 480
      t.boolean :force_ratio_full,    :null => false, :default => false
      t.integer :thumb_width,         :null => false, :default => 150
      t.integer :thumb_height,        :null => false, :default => 150
      t.boolean :force_ratio_thumb,   :null => false, :default => true
      t.timestamps
    end
    add_index :gallery_galleries, :slug
    
    create_table :gallery_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 :gallery_photos, [ :gallery_id, :position ]
    add_index :gallery_photos, :slug
  end

  def self.down
    drop_table :gallery_photos
    drop_table :gallery_galleries
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comfy_gallery-0.1.0 db/migrate/01_create_comfy_gallery.rb