1
0
Fork 0
forked from fedi/mastodon
mastodon/db/migrate/20200718225817_create_circle_accounts.rb
Eugen Rochko 6358072bc0 Add REST API for managing and posting to circles
Circles are the conceptual opposite of lists. A list is a subdivision
of your follows, a circle is a subdivision of your followers. Posting
to a circle means making content available to only some of your
followers. Circles have been internally supported in Mastodon for
the purposes of federation since #8950, this adds the REST API
necessary for making use of them in Mastodon itsef.
2020-07-19 02:05:16 +02:00

15 lines
516 B
Ruby

class CreateCircleAccounts < ActiveRecord::Migration[5.2]
def change
create_table :circle_accounts do |t|
t.belongs_to :circle, foreign_key: { on_delete: :cascade }, null: false
t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
t.belongs_to :follow, foreign_key: { on_delete: :cascade }, null: false
t.timestamps
end
add_index :circle_accounts, [:account_id, :circle_id], unique: true
add_index :circle_accounts, [:circle_id, :account_id]
end
end