lightmigrate-mongodb

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT

README

LightMigrate - MongoDB migration driver

codecov GoDoc GitHub last commit Go Report Card GitHub go.mod Go version GitHub code size in bytes GitHub Release

This module is part of the LightMigrate library. It provides a migration driver for MongoDB.

Features

  • Driver work with mongo through db.runCommands
  • Migrations support json format. It contains array of commands for db.runCommand. Every command is executed in separate request to the database.
  • All json keys have to be in quotes "
  • Examples

Configuration Options

Configuration options can be passed to the constructor using the With<Config-Option> functions.

Config Value Defaults Description
MigrationsCollection schema_migrations Name of the migrations collection.
Transactions false If set to true wrap commands in transaction. Available only for replica set.
Locking disabled / empty The locking configuration, see Locking Config table below.
Logger log.Default() The logger instance that should be used.
VerboseLogging false If set to true, more log messages will be printed.
Locking Config Value Defaults Description
MigrationsCollection migrate_advisory_lock Name of the locking collection.
IndexName lock_unique_key Name of the unique index for the locking collection.
Enabled false A boolean flag to enable the database locking.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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