Documentation
¶
Index ¶
- func ColumnType(ctx *schema.MigratorContext, options schema.ColumnData) func() string
- type Schema
- func (p *Schema) AddVersion(version string)
- func (p Schema) AddVersions(versions []string)
- func (p *Schema) BaseDropIndex(options schema.DropIndexOptions, ...)
- func (p *Schema) Exec(query string, args ...interface{})
- func (p *Schema) FindAppliedVersions() []string
- func (p *Schema) Query(query string, args []interface{}, rowHandler func(row *sql.Rows) error)
- func (p *Schema) RemoveVersion(version string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColumnType ¶
func ColumnType(ctx *schema.MigratorContext, options schema.ColumnData) func() string
Types ¶
type Schema ¶
type Schema struct { // TX is the transaction to execute the queries. TX schema.DB // DB is a database connection but not in a transaction. DB schema.DB Context *schema.MigratorContext // ReversibleMigrationExecutor is a helper to execute reversible migrations in change method. *schema.ReversibleMigrationExecutor }
Schema is the base schema. It is used to support unknown database types and provide a default implementation.
func (*Schema) AddVersion ¶
AddVersion adds a new version to the schema_migrations table. This function is not reversible.
func (Schema) AddVersions ¶
func (*Schema) BaseDropIndex ¶
func (p *Schema) BaseDropIndex( options schema.DropIndexOptions, onRollback func(table schema.TableName, columns []string, opts schema.IndexOptions), )
BaseDropIndex drops an index from the table. Generic method to drop an index across all databases.
func (*Schema) FindAppliedVersions ¶
FindAppliedVersions returns all the applied versions in the schema_migrations table.
func (*Schema) RemoveVersion ¶
RemoveVersion removes a version from the schema_migrations table. This function is not reversible.
Click to show internal directories.
Click to hide internal directories.