mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 17:53:55 +08:00
In
861e2d8bcf
we introduced a duplicate migration version (20251203000001) which
conflicts with core/chat. This commit renames the migration file to
20251203000005 to resolve the conflict, and adds safety to the
migration for sites that have already run it so it is not repeated.
19 lines
616 B
Ruby
Vendored
19 lines
616 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
class CreateChatMessageLinks < ActiveRecord::Migration[7.2]
|
|
def change
|
|
create_table :chat_message_links, if_not_exists: true do |t|
|
|
t.bigint :chat_message_id, null: false
|
|
t.string :url, null: false, limit: 500
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :chat_message_links, :chat_message_id, if_not_exists: true
|
|
add_index :chat_message_links, :url, if_not_exists: true
|
|
add_index :chat_message_links,
|
|
%i[chat_message_id url],
|
|
unique: true,
|
|
name: "unique_chat_message_links",
|
|
if_not_exists: true
|
|
end
|
|
end
|