Skip to content

Commit

Permalink
fix db schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
hhorikawa committed May 16, 2020
1 parent e6f263b commit 803a015
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ tmtags
*.log
*.lock
*.pid
config/connect/facebook.yml
config/connect/google.yml
config/connect/paypal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# https://developers.facebook.com/docs/facebook-login/permissions

development: &defaults
client_id: XXXXXXXXXXXXX
client_secret: XXXXXXXXXXXXXXXXXXXXXXXXXXX
client_id: HERE IS 'APP ID'
client_secret: HERE IS 'APP SECRET'
scope: user_birthday,user_location,email,user_friends,user_gender,user_hometown

# Requires the App Review:
Expand Down
8 changes: 5 additions & 3 deletions db/migrate/20110829024031_create_connect_facebooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
class CreateConnectFacebooks < ActiveRecord::Migration
def self.up
create_table :connect_facebook do |t|
t.belongs_to :account, foreign_key: true
t.string :identifier, null: false, unique: true
t.string :access_token, unique: true
t.references :account, null: false, foreign_key: true
t.string :identifier, null: false
t.string :access_token
t.timestamps
end
add_index :connect_facebook, :access_token, unique: true
add_index :connect_facebook, :identifier, unique: true
end

def self.down
Expand Down
8 changes: 5 additions & 3 deletions db/migrate/20110829024041_create_connect_googles.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
class CreateConnectGoogles < ActiveRecord::Migration
def self.up
create_table :connect_google do |t|
t.belongs_to :account, foreign_key: true
t.string :identifier, null: false, unique: true
t.string :access_token, unique: true
t.references :account, null: false, foreign_key: true
t.string :identifier, null: false
t.string :access_token
t.text :id_token
t.timestamps
end
add_index :connect_google, :access_token, unique: true
add_index :connect_google, :identifier, unique: true
end

def self.down
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20110910061828_create_connect_fakes.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateConnectFakes < ActiveRecord::Migration
def self.up
create_table :connect_fakes do |t|
t.belongs_to :account, foreign_key: true
t.references :account, null: false, foreign_key: true
t.timestamps
end
end
Expand Down
12 changes: 9 additions & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,34 @@
add_index "clients", ["identifier"], name: "index_clients_on_identifier", unique: true

create_table "connect_facebook", force: :cascade do |t|
t.integer "account_id"
t.integer "account_id", null: false
t.string "identifier", null: false
t.string "access_token"
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "connect_facebook", ["access_token"], name: "index_connect_facebook_on_access_token", unique: true
add_index "connect_facebook", ["identifier"], name: "index_connect_facebook_on_identifier", unique: true

create_table "connect_fakes", force: :cascade do |t|
t.integer "account_id"
t.integer "account_id", null: false
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "connect_google", force: :cascade do |t|
t.integer "account_id"
t.integer "account_id", null: false
t.string "identifier", null: false
t.string "access_token"
t.text "id_token"
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "connect_google", ["access_token"], name: "index_connect_google_on_access_token", unique: true
add_index "connect_google", ["identifier"], name: "index_connect_google_on_identifier", unique: true

create_table "id_token_request_objects", force: :cascade do |t|
t.integer "id_token_id"
t.integer "request_object_id"
Expand Down

0 comments on commit 803a015

Please sign in to comment.