Skip to content

Commit

Permalink
feat: expose configuration option to allow missing migrations files o…
Browse files Browse the repository at this point in the history
…n startup
  • Loading branch information
bethesque committed Feb 27, 2020
1 parent 942dfbd commit 58dea9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pact_broker/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def post_configure
def prepare_database
if configuration.auto_migrate_db
logger.info "Migrating database"
PactBroker::DB.run_migrations configuration.database_connection
PactBroker::DB.run_migrations configuration.database_connection, allow_missing_migration_files: configuration.allow_missing_migration_files
else
logger.info "Skipping database migrations"
end
Expand Down
3 changes: 2 additions & 1 deletion lib/pact_broker/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Configuration
:badge_provider_mode
]

attr_accessor :base_url, :log_dir, :database_connection, :auto_migrate_db, :auto_migrate_db_data, :example_data_seeder, :seed_example_data, :use_hal_browser, :html_pact_renderer, :use_rack_protection
attr_accessor :base_url, :log_dir, :database_connection, :auto_migrate_db, :auto_migrate_db_data, :allow_missing_migration_files, :example_data_seeder, :seed_example_data, :use_hal_browser, :html_pact_renderer, :use_rack_protection
attr_accessor :validate_database_connection_config, :enable_diagnostic_endpoints, :version_parser, :sha_generator
attr_accessor :use_case_sensitive_resource_names, :order_versions_by_date
attr_accessor :check_for_potential_duplicate_pacticipant_names
Expand Down Expand Up @@ -64,6 +64,7 @@ def self.default_configuration
config.log_dir = File.expand_path("./log")
config.auto_migrate_db = true
config.auto_migrate_db_data = true
config.allow_missing_migration_files = false
config.use_rack_protection = true
config.use_hal_browser = true
config.validate_database_connection_config = true
Expand Down

0 comments on commit 58dea9a

Please sign in to comment.