-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
30 lines (24 loc) · 1.04 KB
/
config.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
package migrates
// Config define options for all migrations.
type Config struct {
// TableName is the migration table.
TableName string `yaml:"table_name"`
// IDColumnName is the name of column where the migration id will be stored.
IDColumnName string `yaml:"id_column_name"`
// IDColumnSize is the length of the migration id column
IDColumnSize int `yaml:"id_column_size"`
// UseTransaction makes GoMigrate execute migrations inside a single transaction.
// Keep in mind that not all databases support DDL commands inside transactions.
UseTransaction bool `yaml:"use_transaction"`
// ValidateUnknownMigrations will cause migrate to fail if there's unknown migration
// IDs in the database
ValidateUnknownMigrations bool `yaml:"validate_unknown_migrations"`
}
// DefaultConfig can be used if you don't want to think about options.
var DefaultConfig = Config{
TableName: "migrations",
IDColumnName: "id",
IDColumnSize: 255,
UseTransaction: false,
ValidateUnknownMigrations: false,
}