Documentation
¶
Overview ¶
Package migrations is deprecated. Use github.com/shauryagautam/Astra/pkg/database/migration instead.
Index ¶
- func Generate(dir, name string) (string, error)
- type Embedder
- type MigrationRecord
- type Runner
- func (r *Runner) Fresh(ctx context.Context) error
- func (r *Runner) Rollback(ctx context.Context) error
- func (r *Runner) RollbackN(ctx context.Context, n int) error
- func (r *Runner) Run(ctx context.Context) error
- func (r *Runner) Setup(ctx context.Context) error
- func (r *Runner) Status(ctx context.Context) (applied []MigrationRecord, pending []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Embedder ¶
Embedder allows embedding migration SQL files directly into the Go binary.
type MigrationRecord ¶
MigrationRecord represents a migration that has been applied to the database.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner handles running and rolling back migration.
func (*Runner) Fresh ¶
Fresh drops all user tables and re-runs all migration. CAUTION: destructive operation — for development use only.
Click to show internal directories.
Click to hide internal directories.