diff --git a/services/horizon/internal/config.go b/services/horizon/internal/config.go index 2bca813e91..f96851527b 100644 --- a/services/horizon/internal/config.go +++ b/services/horizon/internal/config.go @@ -74,6 +74,9 @@ type Config struct { // ApplyMigrations will apply pending migrations to the horizon database // before starting the horizon service ApplyMigrations bool + // SkipMigrationsCheck will skip checking if there are any migrations + // required + SkipMigrationsCheck bool // CheckpointFrequency establishes how many ledgers exist between checkpoints CheckpointFrequency uint32 // BehindCloudflare determines if Horizon instance is behind Cloudflare. In diff --git a/services/horizon/internal/flags.go b/services/horizon/internal/flags.go index 491be01803..a17a89a534 100644 --- a/services/horizon/internal/flags.go +++ b/services/horizon/internal/flags.go @@ -386,6 +386,14 @@ func Flags() (*Config, support.ConfigOptions) { Required: false, Usage: "applies pending migrations before starting horizon", }, + &support.ConfigOption{ + Name: "skip-migrations-check", + ConfigKey: &config.SkipMigrationsCheck, + OptType: types.Bool, + FlagDefault: false, + Required: false, + Usage: "skips checking if there are migrations required", + }, &support.ConfigOption{ Name: "checkpoint-frequency", ConfigKey: &config.CheckpointFrequency, @@ -443,7 +451,9 @@ func ApplyFlags(config *Config, flags support.ConfigOptions) { } // Migrations should be checked as early as possible - checkMigrations(*config) + if !config.SkipMigrationsCheck { + checkMigrations(*config) + } // Validate options that should be provided together validateBothOrNeither("tls-cert", "tls-key")