Skip to content

DEV: First pass at category_custom_fields step for Discourse converter #32905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: dev/mt/intermediate-db-schema
Choose a base branch
from

Conversation

s3lase
Copy link
Contributor

@s3lase s3lase commented May 26, 2025

This change implements converter step for converting Discourse category_custom_fields to intermediate DB format needed for import into Discourse

@github-actions github-actions bot added the migrations-tooling PR which includes changes to migrations tooling label May 26, 2025
end

def process_item(item)
IntermediateDB::CategoryCustomField.create(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existing_id support might be needed here, Chat seeds category custom fields for SiteSetting.staff_category_id and SiteSetting.general_category_id. Confirm if it's needed

Copy link
Member

@gschlager gschlager May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The importer should do the mapping for existing categories. We shouldn't need to worry about in other steps, I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain how envisage this working?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The converter sets existing_id for seeded categories. The import step for categories notices the existing_id and maps it to the seeded category in the destination site. The category doesn't get imported, but the mapping will be stored (similar to how it's done for existing users).

Since the category_id is mapped, referencing it in category_custom_fields works and will use the correct seeded category.

@s3lase s3lase force-pushed the dev/mt/intermediate-db-schema branch 2 times, most recently from 4e7cc97 to 30518c1 Compare May 26, 2025 16:50
@s3lase s3lase force-pushed the dev/mt/intermediate-db-schema branch from 30518c1 to 681c53f Compare May 27, 2025 01:21
@s3lase s3lase changed the title DEV: First pass at category custom fields step for Discourse converter DEV: First pass at category_custom_fields step for Discourse converter May 27, 2025
This change implements converter step for converting Discourse category custom fields
to intermediate DB format needed for import into Discourse
@s3lase s3lase force-pushed the dev/mt/converter/discourse-category-custom-fields branch from 67c4cac to 90cf9c0 Compare May 27, 2025 02:09
@s3lase s3lase force-pushed the dev/mt/intermediate-db-schema branch 2 times, most recently from 6a4ffb5 to f07383b Compare May 29, 2025 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrations-tooling PR which includes changes to migrations tooling
Development

Successfully merging this pull request may close these issues.

2 participants