mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Largely a removal job, however many tests, particularly system level ones relied on Routes. These have been migrated to use Fns. * Add 410 response to swagger * No app names in log tags * Adding constraint in GetCall for FnID * Adding test to check FnID is required on call * Add fn_id to call selector * Fix text in docker mem warning * Correct buildConfig func name * Test fix up * Removing CPU setting from Agent test CPU setting has been deprecated, but the code base is still riddled with it. This just removes it from this layer. Really we need to remove it from Call. * Remove fn id check on calls * Reintroduce fn id required on call * Adding fnID to calls for execute test * Correct setting of app id in middleware * Removes root middlewares ability to redirect fun invocations * Add over sized test check * Removing call fn id check
46 lines
929 B
Go
46 lines
929 B
Go
package migrations
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/fnproject/fn/api/datastore/sql/migratex"
|
|
"github.com/jmoiron/sqlx"
|
|
)
|
|
|
|
func up20(ctx context.Context, tx *sqlx.Tx) error {
|
|
_, err := tx.ExecContext(ctx, "DROP TABLE routes;")
|
|
|
|
return err
|
|
}
|
|
|
|
func down20(ctx context.Context, tx *sqlx.Tx) error {
|
|
_, err := tx.ExecContext(ctx, `CREATE TABLE IF NOT EXISTS routes (
|
|
app_id varchar(256) NOT NULL,
|
|
path varchar(256) NOT NULL,
|
|
image varchar(256) NOT NULL,
|
|
format varchar(16) NOT NULL,
|
|
memory int NOT NULL,
|
|
cpus int,
|
|
timeout int NOT NULL,
|
|
idle_timeout int NOT NULL,
|
|
tmpfs_size int,
|
|
type varchar(16) NOT NULL,
|
|
headers text NOT NULL,
|
|
config text NOT NULL,
|
|
annotations text NOT NULL,
|
|
created_at text,
|
|
updated_at varchar(256),
|
|
PRIMARY KEY (app_id, path)
|
|
);`)
|
|
|
|
return err
|
|
}
|
|
|
|
func init() {
|
|
Migrations = append(Migrations, &migratex.MigFields{
|
|
VersionFunc: vfunc(20),
|
|
UpFunc: up20,
|
|
DownFunc: down20,
|
|
})
|
|
}
|