Documentation ¶
Index ¶
- func CasbinPermissions(ctx context.Context, db *gorm.DB)
- func CollectionsSetDefaultLocation(ctx context.Context, db *gorm.DB)
- func LogFileScoresToCompetitionScore(db *gorm.DB, circuit string)
- func MakeResourcesPublicWhenNotSet(ctx context.Context, db *gorm.DB)
- func RecomputeDownloadsAndLikes(ctx context.Context, db *gorm.DB)
- func RecomputeZipFileSizes(ctx context.Context, db *gorm.DB)
- func ToModelGitRepositories(ctx context.Context)
- func ToUniqueNamesWithForeignKeys(ctx context.Context, db *gorm.DB)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CasbinPermissions ¶
CasbinPermissions adds read/write permissions to owners of existent Models and Worlds. NOTE: This script is expected to be run just once on each server.
func CollectionsSetDefaultLocation ¶
CollectionsSetDefaultLocation iterates over existing collection DB records and sets the location to those collections having Location = nil.
func LogFileScoresToCompetitionScore ¶
LogFileScoresToCompetitionScore creates CompetitionScore entries from existing log file scores.
func MakeResourcesPublicWhenNotSet ¶
MakeResourcesPublicWhenNotSet updates models and worlds that do not have their private field set (ie. is NULL) to be public instead (ie. private = 0).
func RecomputeDownloadsAndLikes ¶
RecomputeDownloadsAndLikes is a migrate script used to reset Models and Worlds' 'Downloads' and 'Likes' count fields, based on the result of counting how many records exist in model_downloads and model_likes tables (and their worlds counterparts). NOTE: This script is expected to be run just once on each server.
func RecomputeZipFileSizes ¶
RecomputeZipFileSizes updates all models and worlds and set them with the latest zip's file size.
func ToModelGitRepositories ¶
ToModelGitRepositories - migrate to git repositories does 2 things: 1) Migrate from HG to GIT when needed. 2) Tag a model repository with its UUID, if needed. ToModelGitRepositories only runs if the IGN_FUEL_MIGRATE_MODEL_REPOSITORIES env var is set with value 'true'. NOTE: This script is expected to be run just once on each server.
func ToUniqueNamesWithForeignKeys ¶
ToUniqueNamesWithForeignKeys - migrate users and orgazanizations names to unique_owners table. This allows to then create foreign keys on unique names. This migration script only runs if the IGN_FUEL_MIGRATE_UNIQUEOWNERS_TABLE env var is set with value 'true'. NOTE: This script is expected to be run just once on each server.
Types ¶
This section is empty.