Documentation ¶
Index ¶
Constants ¶
View Source
const ( MigrationCollection = "_migration" ErrFileAccess = 0x1 ErrDbAccess = 0x2 ErrDbOperation = 0x4 ErrOrderFailed = 0x8 ErrHashingFailed = 0x16 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MigrationError ¶
func Migrate ¶
func Migrate(dataDir string, db mgo.IDatabase, failOnOrderMismatch bool, collectionIdSuffix ...string) *MigrationError
Migrate begins a DB migration process by migrating the scripts located in the provided data dir and storing the migration track in a migration repository ('_migration' by default)
{dataDir} - The location where the migration scripts are contained {db} - The database client already initialized {failOnOrderMismatch} - Indicates whether the migration should fail if the order of previously migrated scripts have failed (removing or adding scripts between previously migrated scripts) {collectionIdSuffix} - (optional) A suffix to use for the collection name where the migration data is stored. This is useful when sharing the same database instance with multiple services that own their unique collections.
func (*MigrationError) ErrorCode ¶
func (m *MigrationError) ErrorCode() int
func (*MigrationError) Is ¶
func (m *MigrationError) Is(errorCode int) bool
type MigrationErrorCode ¶
type MigrationErrorCode int
Click to show internal directories.
Click to hide internal directories.