Documentation ¶
Index ¶
- Variables
- func CreateFromModel(m model.Model) (*schema.CreateTableBuilder, error)
- func MustMigrateModel(db database.DB, m model.Model)
- func RunModelCreate(ctx context.Context, db database.DB, models ...model.Model) error
- func SrcFile(migrationName, packageName string, up, down fmt.GoStringer) (string, error)
- type DBMigration
- type Migration
- type Migrations
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoChanges = fmt.Errorf("no changes")
)
Functions ¶
func CreateFromModel ¶
func CreateFromModel(m model.Model) (*schema.CreateTableBuilder, error)
func RunModelCreate ¶
Types ¶
type DBMigration ¶
type DBMigration struct { model.BaseModel Name string `db:"name,primary"` Run bool `db:"run"` // contains filtered or unexported fields }
func (*DBMigration) Table ¶
func (m *DBMigration) Table() string
type Migrations ¶
type Migrations struct {
// contains filtered or unexported fields
}
func New ¶
func New() *Migrations
func (*Migrations) Add ¶
func (m *Migrations) Add(migration *Migration)
func (*Migrations) GenerateMigration ¶
Click to show internal directories.
Click to hide internal directories.