-class CreateOauthTables < ActiveRecord::Migration
+class CreateOauthTables < ActiveRecord::Migration[5.0]
def self.up
create_table :client_applications do |t|
t.string :name
t.string :secret, :limit => 50
t.integer :user_id
- t.timestamps
+ t.timestamps :null => true
end
add_index :client_applications, :key, :unique => true
t.string :token, :limit => 50
t.string :secret, :limit => 50
t.timestamp :authorized_at, :invalidated_at
- t.timestamps
+ t.timestamps :null => true
end
add_index :oauth_tokens, :token, :unique => true
t.string :nonce
t.integer :timestamp
- t.timestamps
+ t.timestamps :null => true
end
add_index :oauth_nonces, [:nonce, :timestamp], :unique => true
-
end
def self.down
drop_table :oauth_tokens
drop_table :oauth_nonces
end
-
end