Last active
October 13, 2015 04:47
-
-
Save mscoutermarsh/4141710 to your computer and use it in GitHub Desktop.
api key migration
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 CreateApiKeys < ActiveRecord::Migration | |
| def change | |
| create_table :api_keys do |t| | |
| t.string :access_token, null: false | |
| t.integer :user_id, null: false | |
| t.boolean :active, null: false, default: true | |
| t.datetime :expires_at | |
| t.timestamps | |
| end | |
| add_index :api_keys, ["user_id"], name: "index_api_keys_on_user_id", unique: false | |
| add_index :api_keys, ["access_token"], name: "index_api_keys_on_access_token", unique: true | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment