오, 이 때문에 좋은 옛날식 RUBOCOP(코드 스타일 검사 도구) 처벌을 받았네요
![]()
Offenses:
db/migrate/20231119010101_create_locations_topic_table.rb:6:7: C: Discourse/NoAddReferenceOrAliasesActiveRecordMigration: AR methods add_reference, add_belongs_to, t.references, and t.belongs_to are
high-risk for large tables and have too many background magic operations.
Instead, write a disable_ddl_transactions! migration and write custom SQL to
add the new column and CREATE INDEX CONCURRENTLY. Use the IF NOT EXISTS clause
to make the migration re-runnable if it fails partway through.
t.references :topic, foreign_key: true
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
자, 이것이 문제의 일부일 수도 있겠네요.
너무 많은
마법이 일어나는 게 문제입니다!
살다 보면 배울 점이 있죠! ![]()