18 lines
428 B
Go
18 lines
428 B
Go
|
package migrations
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/uptrace/bun"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
migrations.MustRegister(func(ctx context.Context, db *bun.DB) error {
|
||
|
_, err := db.ExecContext(ctx, "ALTER TABLE servers ADD snapshot_created_at timestamp with time zone")
|
||
|
return err
|
||
|
}, func(ctx context.Context, db *bun.DB) error {
|
||
|
_, err := db.ExecContext(ctx, "ALTER TABLE servers DROP COLUMN snapshot_created_at")
|
||
|
return err
|
||
|
})
|
||
|
}
|