datamigration

package
v0.2.62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
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

type ArticleUserActionResult struct {
	Processed int
	Skipped   int
	Failed    int
}

func BackfillArticleUserAction added in v0.2.41

func BackfillArticleUserAction() ArticleUserActionResult

type NotificationTopicMigrationResult added in v0.2.61

type NotificationTopicMigrationResult struct {
	Updated    int64
	Failed     int
	LastFailed string
}

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

type PostMarkdownResult struct {
	Processed  int
	Failed     int
	LastFailed string
}

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

type ReplyMarkdownResult struct {
	Processed int
	Skipped   int
	Failed    int
}

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

type SiteChromeContentMigrationResult struct {
	Migrated bool
	Failed   int
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL