Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultTable = "schema_migrations"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Engine ¶
Engine runs migration operations using a DB adapter.
type GeneratedMigration ¶
type GeneratedMigration struct {
Version int
Name string
UpPath string
DownPath string
UpSQL string
DownSQL string
}
GeneratedMigration holds generated migration metadata and SQL.
func GenerateFromModelFiles ¶
func GenerateFromModelFiles(dir, dialect, name string, modelFiles []string) (GeneratedMigration, error)
GenerateFromModelFiles parses model structs from Go files and writes migration SQL files.
Exported struct types become tables. Fields and column options are inferred from `orm` tags using the same rules as orm.BuildCreateTableSQL.
Click to show internal directories.
Click to hide internal directories.