-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherrors.go
38 lines (26 loc) · 1.76 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package migrator
// Error declares constant error type.
type Error string
func (e Error) Error() string {
return string(e)
}
// ErrorNoMigrations means that no migrations ware found at the specified path.
const ErrorNoMigrations = Error("No migrations")
// ErrorCommandRequired means that no command was specified.
const ErrorCommandRequired = Error("Command required")
// ErrorUnexpectedCommand means that command name is unknown.
const ErrorUnexpectedCommand = Error("Unexpected command")
// ErrorInvalidVersionArgumentFormat means that the format of an argument named `version` does not correspond to int64.
const ErrorInvalidVersionArgumentFormat = Error("Invalid version argument format")
// ErrorVersionNumberRequired means that no version number was specified via command line.
const ErrorVersionNumberRequired = Error("Version number required")
// ErrorMigrationsCollectionAlreadyExists means that `migrations` collection already in the database.
const ErrorMigrationsCollectionAlreadyExists = Error("Migrations collection already exists")
// ErrorUnequalCountsOfMigrations means that the count of `up` migrations is not equal to the count of `down` migrations.
const ErrorUnequalCountsOfMigrations = Error("Unequal counts of `up` and `down` migrations")
// ErrorMigrationsAreNotInitialized means that migrations collection is empty.
const ErrorMigrationsAreNotInitialized = Error("Migrations are not initialized, try to call `init` at first")
// ErrorTargetVersionNotFound means that the target migration version was not found in migrations list.
const ErrorTargetVersionNotFound = Error("Target migration version was not found")
// ErrorSomeMigrationsAreAbsent means that some migrations files are absent.
const ErrorSomeMigrationsAreAbsent = Error("Some migrations are absent")