Documentation
¶
Index ¶
- Constants
- func EnsureDefaultData()
- type AccessControlMigrationResult
- type ArticleUserActionResult
- type CategoryTopicCountMigrationResult
- type NotificationTopicMigrationResult
- type PointsRecordActionResult
- type PostMarkdownResult
- type PostingSettingsMigrationResult
- type ReplyMarkdownResult
- type ReplySequenceResult
- type ReportLegacyColumnResult
- type SiteChromeContentMigrationResult
- type TopicCountNamingResult
- type TopicMainCategoryMigrationResult
- type TopicMainCategorySearchMigrationResult
- type TopicPostMigrationResult
- func BackfillFileUsagesTopicPost() TopicPostMigrationResult
- func BackfillFileUsagesTopicPostWithDB(conn *gorm.DB) TopicPostMigrationResult
- func BackfillModerationLogsTopicPost() TopicPostMigrationResult
- func BackfillModerationLogsTopicPostWithDB(conn *gorm.DB) TopicPostMigrationResult
- func BackfillTopicPostModel() TopicPostMigrationResult
- func BackfillTopicPostModelWithDB(conn *gorm.DB) TopicPostMigrationResult
- type TopicRestrictedCategoryMigrationResult
- type TopicSearchIndexMigrationResult
- type UserActivityTopicMigrationResult
Constants ¶
const TopicPostMigrationScope = "topic_post_model"
Variables ¶
This section is empty.
Functions ¶
func EnsureDefaultData ¶ added in v0.2.41
func EnsureDefaultData()
Types ¶
type AccessControlMigrationResult ¶ added in v0.2.61
type AccessControlMigrationResult struct {
Groups int
Categories int
Grants int
Failed int
LastFailed string
}
func BackfillAccessControlDefaults ¶ added in v0.2.61
func BackfillAccessControlDefaults() AccessControlMigrationResult
func BackfillAccessControlDefaultsWithDB ¶ added in v0.2.61
func BackfillAccessControlDefaultsWithDB(conn *gorm.DB) AccessControlMigrationResult
type ArticleUserActionResult ¶ added in v0.2.41
func BackfillArticleUserAction ¶ added in v0.2.41
func BackfillArticleUserAction() ArticleUserActionResult
type CategoryTopicCountMigrationResult ¶ added in v0.2.68
func BackfillCategoryTopicCounts ¶ added in v0.2.68
func BackfillCategoryTopicCounts() CategoryTopicCountMigrationResult
func BackfillCategoryTopicCountsWithDB ¶ added in v0.2.68
func BackfillCategoryTopicCountsWithDB(conn *gorm.DB) CategoryTopicCountMigrationResult
type NotificationTopicMigrationResult ¶ added in v0.2.61
func BackfillNotificationTopicIDs ¶ added in v0.2.61
func BackfillNotificationTopicIDs() NotificationTopicMigrationResult
func BackfillNotificationTopicIDsWithDB ¶ added in v0.2.61
func BackfillNotificationTopicIDsWithDB(conn *gorm.DB) NotificationTopicMigrationResult
type PointsRecordActionResult ¶ added in v0.2.49
type PointsRecordActionResult struct {
Backfilled int64
ChangeReasonColumnDropped bool
Failed int
LastFailed string
}
func MigratePointsRecordAction ¶ added in v0.2.49
func MigratePointsRecordAction() PointsRecordActionResult
func MigratePointsRecordActionWithDB ¶ added in v0.2.49
func MigratePointsRecordActionWithDB(conn *gorm.DB) PointsRecordActionResult
type PostMarkdownResult ¶ added in v0.2.53
func RebuildPostMarkdown ¶ added in v0.2.53
func RebuildPostMarkdown() PostMarkdownResult
func RebuildPostMarkdownWithDB ¶ added in v0.2.53
func RebuildPostMarkdownWithDB(conn *gorm.DB) PostMarkdownResult
type PostingSettingsMigrationResult ¶ added in v0.2.62
type PostingSettingsMigrationResult struct {
Updated bool
Skipped bool
Failed int
LastFailed string
}
func EnsurePostingSettingsTopicLimit ¶ added in v0.2.62
func EnsurePostingSettingsTopicLimit() PostingSettingsMigrationResult
type ReplyMarkdownResult ¶
func RebuildReplyMarkdown ¶
func RebuildReplyMarkdown() ReplyMarkdownResult
type ReplySequenceResult ¶ added in v0.2.22
type ReplySequenceResult struct {
Articles int
Replies int
Skipped int
Failed int
LastFailed uint64
}
func BackfillReplySequence ¶ added in v0.2.22
func BackfillReplySequence() ReplySequenceResult
type ReportLegacyColumnResult ¶ added in v0.2.49
type ReportLegacyColumnResult struct {
ArticleIDColumnDropped bool
StatusArticleIndexDrop bool
ArticleIndexDrop bool
Failed int
LastFailed string
}
func DropReportLegacyColumns ¶ added in v0.2.49
func DropReportLegacyColumns() ReportLegacyColumnResult
func DropReportLegacyColumnsWithDB ¶ added in v0.2.49
func DropReportLegacyColumnsWithDB(conn *gorm.DB) ReportLegacyColumnResult
type SiteChromeContentMigrationResult ¶ added in v0.2.45
func MigrateSiteChromeContent ¶ added in v0.2.45
func MigrateSiteChromeContent() SiteChromeContentMigrationResult
type TopicCountNamingResult ¶ added in v0.2.49
type TopicCountNamingResult struct {
UserStatisticsMigrated bool
DailyStatsMigrated int64
Failed int
LastFailed string
}
func MigrateTopicCountNaming ¶ added in v0.2.49
func MigrateTopicCountNaming() TopicCountNamingResult
func MigrateTopicCountNamingWithDB ¶ added in v0.2.49
func MigrateTopicCountNamingWithDB(conn *gorm.DB) TopicCountNamingResult
type TopicMainCategoryMigrationResult ¶ added in v0.2.61
type TopicMainCategoryMigrationResult struct {
Updated int64
Orphaned int64
Failed int
LastFailed string
}
func BackfillTopicMainCategory ¶ added in v0.2.61
func BackfillTopicMainCategory() TopicMainCategoryMigrationResult
BackfillTopicMainCategory copies the first non-zero entry of every topic's category list into the new main_category_id column. It is purely additive: no topic changes categories, no row is deleted, and re-running it is a no-op because only rows still at 0 are considered.
func BackfillTopicMainCategoryWithDB ¶ added in v0.2.61
func BackfillTopicMainCategoryWithDB(conn *gorm.DB) TopicMainCategoryMigrationResult
type TopicMainCategorySearchMigrationResult ¶ added in v0.2.61
type TopicMainCategorySearchMigrationResult struct {
Skipped bool
Rebuilt bool
ProcessedCount int
FailedCount int
Failed int
LastFailed string
}
func RebuildTopicMainCategorySearchIndex ¶ added in v0.2.61
func RebuildTopicMainCategorySearchIndex() TopicMainCategorySearchMigrationResult
RebuildTopicMainCategorySearchIndex upgrades existing search documents with the new mainCategory field. A configured but unavailable Meilisearch is a migration failure: advancing the version would otherwise leave search empty until an operator happens to rebuild the index manually.
type TopicPostMigrationResult ¶ added in v0.2.49
type TopicPostMigrationResult struct {
Topics int
Posts int
Categories int
TopicCategoryIndexes int
TopicUserActions int
TopicUserStats int
Mappings int
Notifications int
ReportsChecked int
ReportsMissing int
FileUsages int
FileUsagesMissing int
ModerationLogs int
ModerationLogsMissing int
Skipped int
Failed int
LastFailed string
}
func BackfillFileUsagesTopicPost ¶ added in v0.2.49
func BackfillFileUsagesTopicPost() TopicPostMigrationResult
func BackfillFileUsagesTopicPostWithDB ¶ added in v0.2.49
func BackfillFileUsagesTopicPostWithDB(conn *gorm.DB) TopicPostMigrationResult
func BackfillModerationLogsTopicPost ¶ added in v0.2.49
func BackfillModerationLogsTopicPost() TopicPostMigrationResult
func BackfillModerationLogsTopicPostWithDB ¶ added in v0.2.49
func BackfillModerationLogsTopicPostWithDB(conn *gorm.DB) TopicPostMigrationResult
func BackfillTopicPostModel ¶ added in v0.2.49
func BackfillTopicPostModel() TopicPostMigrationResult
func BackfillTopicPostModelWithDB ¶ added in v0.2.49
func BackfillTopicPostModelWithDB(conn *gorm.DB) TopicPostMigrationResult
type TopicRestrictedCategoryMigrationResult ¶ added in v0.2.61
type TopicRestrictedCategoryMigrationResult struct {
Updated int64
RemovedCategoryLinks int64
Failed int
LastFailed string
}
func EnforceSingleRestrictedTopicCategory ¶ added in v0.2.61
func EnforceSingleRestrictedTopicCategory() TopicRestrictedCategoryMigrationResult
EnforceSingleRestrictedTopicCategory repairs selections created before the invariant existed without changing a topic's audience. If the main category is restricted, it is kept alone. If the main category is public, restricted auxiliary tags are removed while all public categories keep their order.
func EnforceSingleRestrictedTopicCategoryWithDB ¶ added in v0.2.61
func EnforceSingleRestrictedTopicCategoryWithDB(conn *gorm.DB) TopicRestrictedCategoryMigrationResult
type TopicSearchIndexMigrationResult ¶ added in v0.2.49
type TopicSearchIndexMigrationResult struct {
Skipped bool `json:"skipped"`
Rebuilt bool `json:"rebuilt"`
ProcessedCount int `json:"processedCount"`
FailedCount int `json:"failedCount"`
LegacyIndexDeleteTried bool `json:"legacyIndexDeleteTried"`
LegacyIndexDeleted bool `json:"legacyIndexDeleted"`
Failed int `json:"failed"`
LastFailed string `json:"lastFailed"`
}
func MigrateTopicSearchIndex ¶ added in v0.2.49
func MigrateTopicSearchIndex() TopicSearchIndexMigrationResult
type UserActivityTopicMigrationResult ¶ added in v0.2.61
type UserActivityTopicMigrationResult struct {
Topics int64
Posts int64
Missing int64
Failed int
LastFailed string
}
func BackfillUserActivityTopicIDs ¶ added in v0.2.61
func BackfillUserActivityTopicIDs() UserActivityTopicMigrationResult
func BackfillUserActivityTopicIDsWithDB ¶ added in v0.2.61
func BackfillUserActivityTopicIDsWithDB(conn *gorm.DB) UserActivityTopicMigrationResult
Source Files
¶
- access_control.go
- article_user_action.go
- category_topic_count.go
- default_data.go
- notification_topic.go
- points_record_action.go
- post_markdown.go
- posting_settings.go
- reply_markdown.go
- reply_sequence.go
- report_legacy_column.go
- site_chrome.go
- topic_count_naming.go
- topic_main_category.go
- topic_post_model.go
- topic_restricted_category.go
- topic_search_index.go
- user_activity_topic.go