Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorcmrd Senya <senya@riseup.net>2017-08-13 22:05:25 +0300
committercmrd Senya <senya@riseup.net>2017-08-15 01:32:34 +0300
commit45619cb153e133d32e0fc022ff2d62f69608f648 (patch)
treec8d6ac723779e33f252b8716e1b6f31107b629b0 /db
parente2979df65a080ef94f21e371c34f09af430284f4 (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.rb14
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