mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
723dc1fa55
The primary key is usually a bigint column, but the foreign key columns are usually of integer type. This can lead to issues when joining these columns due to mismatched types and different value ranges. This was using a temporary plugin / test API to make tests pass. After more careful consideration, we concluded that it is safe to alter the tables directly.
12 lines
233 B
Ruby
12 lines
233 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AlterBookmarksIdsToBigint < ActiveRecord::Migration[7.1]
|
|
def up
|
|
change_column :bookmarks, :bookmarkable_id, :bigint
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|