Sha256: a9b0874bff33bd23c7190301962a2f37601f4210199226dc59bf7ed3e14415dc

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

# encoding: UTF-8
class CreateRatings < ActiveRecord::Migration
  def self.up
    create_table(:ratings) do |t|
      t.column :ratetor_id, :integer, :null => false
      t.column :ratetor_type, :string, :null => false
      t.column :rate, :float, :null => false
      t.column :rateable_id, :integer, :null => false
      t.column :rateable_type, :string

      t.timestamps
    end

    add_index :ratings, [:rateable_id, :rateable_type]
  end

  def self.down
    drop_table :ratings
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spleen-0.0.2 lib/generators/spleen/templates/migration.rb
spleen-0.0.1 lib/generators/spleen/templates/migration.rb