File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -60,13 +60,6 @@ func (e *ParserErr) Error() string {
60
60
return fmt .Sprintf ("multiple errors: %d errors" , len (e .Errs ))
61
61
}
62
62
63
- func addFile (files []string , newFile string ) []string {
64
- if migrations .IsDown (newFile ) {
65
- return files
66
- }
67
- return append (files , newFile )
68
- }
69
-
70
63
func ReadSQLFiles (paths []string ) ([]string , error ) {
71
64
var files []string
72
65
for _ , path := range paths {
@@ -81,10 +74,15 @@ func ReadSQLFiles(paths []string) ([]string, error) {
81
74
return nil , err
82
75
}
83
76
for _ , f := range listing {
84
- files = addFile (files , filepath .Join (path , f .Name ()))
77
+ if migrations .IsDown (f .Name ()) {
78
+ continue
79
+ }
80
+ files = append (files , filepath .Join (path , f .Name ()))
85
81
}
86
82
} else {
87
- files = addFile (files , path )
83
+ if ! migrations .IsDown (path ) {
84
+ files = append (files , path )
85
+ }
88
86
}
89
87
}
90
88
return files , nil
You can’t perform that action at this time.
0 commit comments