X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7b384f03ab1d34fd3ebcc5ae3add25b3b5591e2e..c0bdcd53d2c04638a7490400e2abb43c88fe99ad:/db/migrate/040_create_oauth_tables.rb diff --git a/db/migrate/040_create_oauth_tables.rb b/db/migrate/040_create_oauth_tables.rb index 95d690512..5306b173e 100644 --- a/db/migrate/040_create_oauth_tables.rb +++ b/db/migrate/040_create_oauth_tables.rb @@ -1,4 +1,4 @@ -class CreateOauthTables < ActiveRecord::Migration +class CreateOauthTables < ActiveRecord::Migration[4.2] def self.up create_table :client_applications do |t| t.string :name @@ -9,10 +9,10 @@ class CreateOauthTables < ActiveRecord::Migration t.string :secret, :limit => 50 t.integer :user_id - t.timestamps + t.timestamps :null => true end add_index :client_applications, :key, :unique => true - + create_table :oauth_tokens do |t| t.integer :user_id t.string :type, :limit => 20 @@ -20,19 +20,18 @@ class CreateOauthTables < ActiveRecord::Migration 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 - + create_table :oauth_nonces do |t| 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 @@ -40,5 +39,4 @@ class CreateOauthTables < ActiveRecord::Migration drop_table :oauth_tokens drop_table :oauth_nonces end - end