mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
REFACTOR: Migrate InstagramAuthenticator to use ManagedAuthenticator (#7081)
This commit is contained in:
27
db/migrate/20190227150413_migrate_instagram_user_info.rb
Normal file
27
db/migrate/20190227150413_migrate_instagram_user_info.rb
Normal file
@ -0,0 +1,27 @@
|
||||
class MigrateInstagramUserInfo < ActiveRecord::Migration[5.2]
|
||||
def up
|
||||
execute <<~SQL
|
||||
INSERT INTO user_associated_accounts (
|
||||
provider_name,
|
||||
provider_uid,
|
||||
user_id,
|
||||
info,
|
||||
last_used,
|
||||
created_at,
|
||||
updated_at
|
||||
) SELECT
|
||||
'instagram',
|
||||
instagram_user_id,
|
||||
user_id,
|
||||
json_build_object('nickname', screen_name),
|
||||
updated_at,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM instagram_user_infos
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user