diff options
author | ThibG <thib@sitedethib.com> | 2018-05-11 20:34:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-11 20:34:19 +0200 |
commit | da8897aaefeedf281a72f2e3b1b88ea0573e481e (patch) | |
tree | 53a6ce915f8687b15e5bd5d06a53d08ed764d3da /db/migrate | |
parent | e7ed61917b045f15776adbf257501dc9dac85557 (diff) | |
parent | 45fce0e496727cd1579c630c22592638341f78c6 (diff) |
Merge pull request #477 from ThibG/glitch-soc/merge
Merge upstream changes
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb | 6 | ||||
-rw-r--r-- | db/migrate/20180510230049_migrate_web_push_subscriptions.rb | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb b/db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb new file mode 100644 index 000000000..94ef8e0f5 --- /dev/null +++ b/db/migrate/20180510214435_add_access_token_id_to_web_push_subscriptions.rb @@ -0,0 +1,6 @@ +class AddAccessTokenIdToWebPushSubscriptions < ActiveRecord::Migration[5.2] + def change + add_reference :web_push_subscriptions, :access_token, null: true, default: nil, foreign_key: { on_delete: :cascade, to_table: :oauth_access_tokens }, index: false + add_reference :web_push_subscriptions, :user, null: true, default: nil, foreign_key: { on_delete: :cascade }, index: false + end +end diff --git a/db/migrate/20180510230049_migrate_web_push_subscriptions.rb b/db/migrate/20180510230049_migrate_web_push_subscriptions.rb new file mode 100644 index 000000000..6de1bed79 --- /dev/null +++ b/db/migrate/20180510230049_migrate_web_push_subscriptions.rb @@ -0,0 +1,13 @@ +class MigrateWebPushSubscriptions < ActiveRecord::Migration[5.2] + disable_ddl_transaction! + + def up + add_index :web_push_subscriptions, :user_id, algorithm: :concurrently + add_index :web_push_subscriptions, :access_token_id, algorithm: :concurrently + end + + def down + remove_index :web_push_subscriptions, :user_id + remove_index :web_push_subscriptions, :access_token_id + end +end |