Progress on dms, code cleanup
Progress on dms, code cleanup
This commit is contained in:
9
db/migrate/20201127051070_create_chat_conversations.rb
Normal file
9
db/migrate/20201127051070_create_chat_conversations.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class CreateChatConversations < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :chat_conversations do |t|
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
14
db/migrate/20201127051071_create_chat_blocks.rb
Normal file
14
db/migrate/20201127051071_create_chat_blocks.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateChatBlocks < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :chat_blocks do |t|
|
||||
t.integer :account_id, null: false
|
||||
t.integer :target_account_id, null: false
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :chat_blocks, [:account_id, :target_account_id], unique: true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
12
db/migrate/20201127051072_create_chat_mutes.rb
Normal file
12
db/migrate/20201127051072_create_chat_mutes.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateChatMutes < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :chat_mutes do |t|
|
||||
t.integer :account_id, null: false
|
||||
t.integer :target_account_id, null: false
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :chat_mutes, [:account_id, :target_account_id], unique: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
class CreateChatConversationAccounts < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :chat_conversation_accounts do |t|
|
||||
t.belongs_to :account, foreign_key: { on_delete: :cascade }
|
||||
t.belongs_to :chat_conversation, foreign_key: { on_delete: :cascade }
|
||||
t.bigint :participant_account_ids, array: true, null: false, default: []
|
||||
t.bigint :last_chat_message_id, null: true, default: nil
|
||||
t.boolean :is_unread, null: false, default: false
|
||||
t.boolean :is_hidden, null: false, default: false
|
||||
t.boolean :is_approved, null: false, default: false
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
14
db/migrate/20201127051074_create_chat_messages.rb
Normal file
14
db/migrate/20201127051074_create_chat_messages.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateChatMessages < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :chat_messages do |t|
|
||||
t.text :text, null: false, default: ''
|
||||
t.text :language, null: false, default: ''
|
||||
t.integer :from_account_id, null: false
|
||||
t.integer :chat_conversation_id, null: false
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :chat_messages, [:from_account_id, :chat_conversation_id]
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class RemoveDisabledFromCustomEmojis < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
safety_assured { remove_column :custom_emojis, :disabled }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user