diff options
author | cmrd Senya <senya@riseup.net> | 2017-08-13 22:05:25 +0300 |
---|---|---|
committer | cmrd Senya <senya@riseup.net> | 2017-08-15 01:32:34 +0300 |
commit | 45619cb153e133d32e0fc022ff2d62f69608f648 (patch) | |
tree | c8d6ac723779e33f252b8716e1b6f31107b629b0 /db | |
parent | e2979df65a080ef94f21e371c34f09af430284f4 (diff) |
Account migration model and message support
This commit introduces support for AccountMigration federation message
receive. It covers the cases when the new home pod for a user is remote
respective to the recepient pod of the message. It also allows to initiate
migration locally by a podmin from the rails console. This will give the
pods a possibility to understand the account migration event on the
federation level and thus future version which will implement migration
will be backward compatible with the pods starting from this commit.
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170730154117_create_account_migrations.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/db/migrate/20170730154117_create_account_migrations.rb b/db/migrate/20170730154117_create_account_migrations.rb new file mode 100644 index 000000000..b01eadbc6 --- /dev/null +++ b/db/migrate/20170730154117_create_account_migrations.rb @@ -0,0 +1,14 @@ +class CreateAccountMigrations < ActiveRecord::Migration[5.1] + def change + create_table :account_migrations do |t| + t.integer :old_person_id, null: false + t.integer :new_person_id, null: false + end + + add_foreign_key :account_migrations, :people, column: :old_person_id + add_foreign_key :account_migrations, :people, column: :new_person_id + + add_index :account_migrations, %i[old_person_id new_person_id], unique: true + add_index :account_migrations, :old_person_id, unique: true + end +end |