migrate

package
v0.0.0-...-4436486 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CasbinPermissions

func CasbinPermissions(ctx context.Context, db *gorm.DB)

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

func CollectionsSetDefaultLocation(ctx context.Context, db *gorm.DB)

CollectionsSetDefaultLocation iterates over existing collection DB records and sets the location to those collections having Location = nil.

func LogFileScoresToCompetitionScore

func LogFileScoresToCompetitionScore(db *gorm.DB, circuit string)

LogFileScoresToCompetitionScore creates CompetitionScore entries from existing log file scores.

func MakeResourcesPublicWhenNotSet

func MakeResourcesPublicWhenNotSet(ctx context.Context, db *gorm.DB)

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

func RecomputeDownloadsAndLikes(ctx context.Context, db *gorm.DB)

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

func RecomputeZipFileSizes(ctx context.Context, db *gorm.DB)

RecomputeZipFileSizes updates all models and worlds and set them with the latest zip's file size.

func ToModelGitRepositories

func ToModelGitRepositories(ctx context.Context)

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

func ToUniqueNamesWithForeignKeys(ctx context.Context, db *gorm.DB)

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.

Jump to

Keyboard shortcuts

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