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:
Reed Allman
2018-03-13 14:12:34 -07:00
committed by GitHub
parent 1f43545b63
commit 4084b727c0
697 changed files with 16924 additions and 35406 deletions

View File

@@ -1387,13 +1387,17 @@ func (p PropertyMap) Value() (driver.Value, error) {
func (p PropertyMap) Scan(src interface{}) error {
v := reflect.ValueOf(src)
if !v.IsValid() || v.IsNil() {
if !v.IsValid() || v.CanAddr() && v.IsNil() {
return nil
}
if data, ok := src.([]byte); ok {
return json.Unmarshal(data, &p)
switch ts := src.(type) {
case []byte:
return json.Unmarshal(ts, &p)
case string:
return json.Unmarshal([]byte(ts), &p)
default:
return fmt.Errorf("Could not not decode type %T -> %T", src, p)
}
return fmt.Errorf("Could not not decode type %T -> %T", src, p)
}
func TestEmbeddedMaps(t *testing.T) {
@@ -1493,6 +1497,9 @@ func TestIn(t *testing.T) {
{"SELECT * FROM foo WHERE x in (?)",
[]interface{}{[]int{1, 2, 3, 4, 5, 6, 7, 8}},
8},
{"SELECT * FROM foo WHERE x = ? AND y in (?)",
[]interface{}{[]byte("foo"), []int{0, 5, 3}},
4},
}
for _, test := range tests {
q, a, err := In(test.q, test.args...)