diff --git a/db/migrate/20181121064652_create_oauth.rb b/db/migrate/20181121064652_create_oauth.rb deleted file mode 100644 index b54d00d6d..000000000 --- a/db/migrate/20181121064652_create_oauth.rb +++ /dev/null @@ -1,18 +0,0 @@ -class CreateOauth < ActiveRecord::Migration - def change - create_table :oauth do |t| - t.string :client_id - t.string :client_secret - t.string :code - t.string :redirect_uri - t.string :scope - - t.string :access_token - t.string :refresh_token - t.integer :token_created_at - t.integer :token_expires_in #过期时间 - - t.timestamps - end - end -end diff --git a/db/migrate/20181122034752_add_user_id_to_oauths.rb b/db/migrate/20181122034752_add_user_id_to_oauths.rb index a28d2fa4c..e919939f0 100644 --- a/db/migrate/20181122034752_add_user_id_to_oauths.rb +++ b/db/migrate/20181122034752_add_user_id_to_oauths.rb @@ -1,5 +1,22 @@ class AddUserIdToOauths < ActiveRecord::Migration def change + + create_table :oauths do |t| + t.string :client_id + t.string :client_secret + t.string :code + t.string :redirect_uri + t.string :scope + + t.string :access_token + t.string :refresh_token + t.integer :token_created_at + t.integer :token_expires_in #过期时间 + + t.timestampss + end + + add_column :oauths, :user_id, :integer, default: 0 add_index :oauths, :user_id