Documentation ¶
Index ¶
- Variables
- func CreateFromModel(m models.Model) (*schema.CreateTableBuilder, error)
- func RunModelCreate(ctx context.Context, db builder.QueryExecer, models ...models.Model) error
- func SrcFile(migrationName, packageName string, up, down ToGoer) (string, error)
- type DBMigration
- type Migration
- type Migrations
- type ToGoer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoChanges = fmt.Errorf("no changes")
)
Functions ¶
func CreateFromModel ¶ added in v0.18.0
func CreateFromModel(m models.Model) (*schema.CreateTableBuilder, error)
func RunModelCreate ¶ added in v0.21.0
Types ¶
type DBMigration ¶ added in v0.18.0
type DBMigration struct { models.BaseModel Name string `db:"name,primary"` Run bool `db:"run"` // contains filtered or unexported fields }
func (*DBMigration) Table ¶ added in v0.18.0
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 ¶
func (*Migrations) Up ¶
func (m *Migrations) Up(ctx context.Context, db builder.QueryExecer) error
Click to show internal directories.
Click to hide internal directories.