Created
July 27, 2018 14:41
-
-
Save ryenski/ac256aff4c9fcbc3d1fd014b3bc2aba3 to your computer and use it in GitHub Desktop.
Oauth Identities
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
# == Schema Information | |
# | |
# Table name: identities | |
# | |
# id :integer not null, primary key | |
# user_id :integer | |
# provider :string | |
# uid :string | |
# created_at :datetime not null | |
# updated_at :datetime not null | |
# metadata :json | |
# | |
# Store Oauth identities for a user. | |
# Each | |
class Identity < ApplicationRecord | |
belongs_to :user, autosave: true | |
validates :uid, :provider, presence: true | |
validates :uid, uniqueness: {scope: [:provider]} | |
end |
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
create_table "identities", id: :serial, force: :cascade do |t| | |
t.integer "user_id" | |
t.string "provider" | |
t.string "uid" | |
t.datetime "created_at", null: false | |
t.datetime "updated_at", null: false | |
t.json "metadata" | |
t.index ["user_id"], name: "index_identities_on_user_id" | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment