6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/devise_oauth2_token_bearer_authenticatable/schema.rb', line 6
def self.up(migration)
migration.create_table :clients do |t|
t.string :name
t.string :redirect_uri
t.string :website
t.string :identifier
t.string :secret
t.timestamps
end
migration.add_index :clients, :identifier
migration.create_table :access_tokens do |t|
t.belongs_to :user, :client
t.string :token
t.datetime :expires_at
t.timestamps
end
migration.add_index :access_tokens, :token
migration.add_index :access_tokens, :expires_at
migration.create_table :refresh_tokens do |t|
t.belongs_to :user, :client
t.string :token
t.datetime :expires_at
t.timestamps
end
migration.add_index :refresh_tokens, :token
migration.add_index :refresh_tokens, :expires_at
migration.create_table :authorization_codes do |t|
t.belongs_to :user, :client
t.string :token
t.datetime :expires_at
t.string :redirect_uri
t.timestamps
end
migration.add_index :authorization_codes, :token
migration.add_index :authorization_codes, :expires_at
end
|