Created
February 6, 2012 09:40
-
-
Save kalleth/1751084 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateLoginRecords < ActiveRecord::Migration | |
def self.up | |
create_table :login_records do |t| | |
t.integer :user_id | |
t.datetime :logged_in | |
t.timestamps | |
end | |
add_index(:login_records, :user_id) | |
add_index(:login_records, :logged_in) | |
end | |
def self.down | |
drop_table :login_records | |
#_should_ remove indexes as well, but if not, you need to remove_index/drop_index/del_index here | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment