한 포럼의 사용자, 주제, 게시물을 다른 포럼으로 병합하고 싶습니다. 개발 환경에 포럼을 복원하는 데는 문제가 없지만, 병합을 시도할 때(현재는 새로 설치된 환경으로) PG::ForeignKeyViolation 오류가 발생합니다. 데이터베이스의 무결성을 확인할 수 있는 Discourse 도구가 있는지 궁금합니다. 없다면 다른 팁이나 아이디어가 있을까요?
(데이터베이스 관련 문제와 관련된 몇 가지 주제도 있어서, 현재 그런 도구가 없다면 DC 팀이 이 기능을 도입할 가치가 있다고 생각할지 궁금합니다.)
대부분 bigint에서 integer로, character varying(255)에서 character varying으로 변경된 것과 몇 가지 not null 제약이 누락된 것뿐이지만, 일부 인덱스도 누락되어 있습니다.
그것을 가리키는 라인들은 다음과 같습니다:
1646행 - 누락:
Index "public.index_badges_on_badge_type_id"
Column | Type | Key? | Definition Column | Type | Key? | Definition
--------+------------------------+------+------------ ---------------+---------+------+---------------
name | character varying(255) | yes | name badge_type_id | integer | yes | badge_type_id
btree, for table "public.badges"
3301행 - 누락:
Index "public.index_user_badges_on_user_id"
Column | Type | Key? | Definition
---------+---------+------+------------
user_id | integer | yes | user_id
btree, for table "public.user_badges"
4639행 - 누락:
Index "public.schema_migrations_pkey"
Column | Type | Key? | Definition
---------+-------------------+------+------------
version | character varying | yes | version
primary key, btree, for table "public.schema_migrations"
5487행 - 일부 누락:
Table "public.topic_search_data"
Column | Type | Collation | Nullable | Default Column | Type | Collation | Nullable | Default
-------------+------------------------+-----------+----------+--------- -------------+-------------------+-----------+----------+-----------------------------------------------------
topic_id | integer | | not null | topic_id | integer | | not null | nextval('topic_search_data_topic_id_seq'::regclass)
raw_data | text | | | raw_data | text | | |
locale | character varying(255) | | not null | locale | character varying | | not null |
search_data | tsvector | | | search_data | tsvector | | |
version | integer | | | 0 version | integer | | | 0