Files
fn-serverless/api/datastore/sql/migrations/8_add_annotations_app.go
Owen Cliffe d25b5af59d Add annotations to routes and apps (#866)
Adds 'annotations' attribute to Routes and Apps
2018-03-20 18:02:49 +00:00

28 lines
550 B
Go

package migrations
import (
"context"
"github.com/fnproject/fn/api/datastore/sql/migratex"
"github.com/jmoiron/sqlx"
)
func up8(ctx context.Context, tx *sqlx.Tx) error {
_, err := tx.ExecContext(ctx, "ALTER TABLE apps ADD annotations TEXT;")
return err
}
func down8(ctx context.Context, tx *sqlx.Tx) error {
_, err := tx.ExecContext(ctx, "ALTER TABLE apps DROP COLUMN annotations;")
return err
}
func init() {
Migrations = append(Migrations, &migratex.MigFields{
VersionFunc: vfunc(8),
UpFunc: up8,
DownFunc: down8,
})
}