Files
fn-serverless/api/datastore/sql/migrations/9_add_annotations_route.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
554 B
Go

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