24 lines
445 B
Go
24 lines
445 B
Go
package migrations
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"fr.latosa-escrima/core/models"
|
|
"github.com/uptrace/bun"
|
|
)
|
|
|
|
func init() {
|
|
Migrations.MustRegister(func(ctx context.Context, db *bun.DB) error {
|
|
fmt.Print(" [up migration] ")
|
|
_, err := db.NewDropColumn().
|
|
Model((*models.Event)(nil)).
|
|
ColumnExpr("status").
|
|
Exec(ctx)
|
|
return err
|
|
}, func(ctx context.Context, db *bun.DB) error {
|
|
fmt.Print(" [down migration] ")
|
|
return nil
|
|
})
|
|
}
|