Sha256: 363200513fbcefb955d17706a8083f9da632997979549003fba26452ffa2333e

Contents?: true

Size: 962 Bytes

Versions: 3

Compression:

Stored size: 962 Bytes

Contents

ActiveRecord::Schema.define :version => 0 do
  create_table :voteable_models, :force => true do |t|
    t.string :name
    t.integer :up_votes, :null => false, :default => 0
    t.integer :down_votes, :null => false, :default => 0
  end

  create_table :voter_models, :force => true do |t|
    t.string :name
    t.integer :up_votes, :null => false, :default => 0
    t.integer :down_votes, :null => false, :default => 0
  end

  create_table :invalid_voteable_models, :force => true do |t|
    t.string :name
  end

  create_table :votings, :force => true do |t|
     t.string :voteable_type
     t.integer :voteable_id
     t.string :voter_type
     t.integer :voter_id
     t.boolean :up_vote, :null => false

     t.timestamps
  end

  add_index :votings, [:voteable_type, :voteable_id]
  add_index :votings, [:voter_type, :voter_id]
  add_index :votings, [:voteable_type, :voteable_id, :voter_type, :voter_id], :name => "unique_voters", :unique => true
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
make_voteable-0.1.1 spec/schema.rb
make_voteable-0.1.0 spec/schema.rb
make_voteable-0.0.2 spec/schema.rb