~cytrogen/masto-fe

ref: 1f141f656dc3fd2b3af5d6edde331bac31bb6526 masto-fe/db/migrate/20180929222014_create_account_conversations.rb -rw-r--r-- 714 bytes
1f141f65 — Eugen Rochko Change onboarding prompt to use full width of banner in web UI (#26829) 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

class CreateAccountConversations < ActiveRecord::Migration[5.2]
  def change
    create_table :account_conversations do |t|
      t.belongs_to :account, foreign_key: { on_delete: :cascade }
      t.belongs_to :conversation, foreign_key: { on_delete: :cascade }
      t.bigint :participant_account_ids, array: true, null: false, default: []
      t.bigint :status_ids, array: true, null: false, default: []
      t.bigint :last_status_id, null: true, default: nil
      t.integer :lock_version, null: false, default: 0
    end

    add_index :account_conversations, [:account_id, :conversation_id, :participant_account_ids], unique: true, name: 'index_unique_conversations'
  end
end