안녕하세요, 배경 설명을 드리자면 posts 테이블의 스키마에 새로운 컬럼을 추가하려고 합니다. 추가하려는 컬럼은 meta_tag_id입니다. PostController의 파라미터로 저장하려는 데이터를 전달할 수 있는 단계까지 왔으며, 참고용으로 아래 로그를 확인해 주세요(이것은 d/rails s의 로그입니다):
Started POST "/posts" for 127.0.0.1 at 2022-09-16 06:08:19 +0000
Processing by PostsController#create as */*
Parameters: {"raw"=>"Another dummy reply, for testing purposes.", "unlist_topic"=>"false", "category"=>"5", "topic_id"=>"23", "is_warning"=>"false", "archetype"=>"regular", "typing_duration_msecs"=>"4500", "composer_open_duration_msecs"=>"11534", "featured_link"=>"", "shared_draft"=>"false", "draft_key"=>"topic_23", "meta_tag_id"=>"summary", "nested_post"=>"true"}
제가 달성하고 싶은 목표는 meta_tag_id 파라미터
를 posts 테이블의 다른 컬럼에 삽입하는 것입니다. 참고로, posts 테이블에 레코드를 삽입할 때의 SQL 쿼리 샘플 로그는 다음과 같습니다:
Post Create (1.1ms) INSERT INTO "posts" ("user_id", "topic_id", "post_number", "raw", "cooked", "created_at", "updated_at", "sort_order", "last_editor_id", "last_version_at", "word_count", "baked_at", "baked_version") VALUES (1, 23, 7, 'Another dummy reply, for testing purposes.', '<p>Another dummy reply, for testing purposes.</p>', '2022-09-16 06:08:22.283658', '2022-09-16 06:08:22.283658', 7, 1, '2022-09-16 06:08:22.293786', 6, '2022-09-16 06:08:22.283601', 2) RETURNING "id"
제게 올바른 방향을 알려주시면 감사하겠습니다. 저는 Ruby에 익숙하지 않아서, 새 컬럼을 추가하고 쿼리의 값에 meta_tag_id 변수를 포함시키기 위해 수정해야 할 파일을 찾는 데 어려움을 겪고 있습니다. 미리 감사드립니다! ![]()