mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
phase 2: mattes/migrate -> migratex (#848)
* move mattes migrations to migratex * changes format of migrations to migratex format * updates test runner to use new interface (double checked this with printlns, the tests go fully down and then up, and work on pg/mysql) * remove mattes/migrate * update tests from deps * update readme * fix other file extensions
This commit is contained in:
@@ -14,15 +14,15 @@ const testsqlite3 = "file::memory:?mode=memory&cache=shared"
|
||||
|
||||
type tm struct{}
|
||||
|
||||
func (t *tm) Up(tx *sqlx.Tx) error {
|
||||
_, err := tx.Exec(`CREATE TABLE IF NOT EXISTS foo (
|
||||
func (t *tm) Up(ctx context.Context, tx *sqlx.Tx) error {
|
||||
_, err := tx.ExecContext(ctx, `CREATE TABLE IF NOT EXISTS foo (
|
||||
bar bigint NOT NULL PRIMARY KEY
|
||||
)`)
|
||||
return err
|
||||
}
|
||||
|
||||
func (t *tm) Down(tx *sqlx.Tx) error {
|
||||
_, err := tx.Exec("DROP TABLE foo")
|
||||
func (t *tm) Down(ctx context.Context, tx *sqlx.Tx) error {
|
||||
_, err := tx.ExecContext(ctx, "DROP TABLE foo")
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user