thingspeak/db/migrate/20110428182848_create_watchings.rb

19 lines
342 B
Ruby
Raw Normal View History

class CreateWatchings < ActiveRecord::Migration
def self.up
create_table :watchings do |t|
t.integer :user_id
t.integer :channel_id
t.timestamps
end
add_index :watchings, [:user_id, :channel_id]
end
def self.down
remove_index :watchings, [:user_id, :channel_id]
drop_table :watchings
end
end