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 {
6060 return fmt .Sprintf ("multiple errors: %d errors" , len (e .Errs ))
6161}
6262
63- func addFile (files []string , newFile string ) []string {
64- if migrations .IsDown (newFile ) {
65- return files
66- }
67- return append (files , newFile )
68- }
69-
7063func ReadSQLFiles (paths []string ) ([]string , error ) {
7164 var files []string
7265 for _ , path := range paths {
@@ -81,10 +74,15 @@ func ReadSQLFiles(paths []string) ([]string, error) {
8174 return nil , err
8275 }
8376 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 ()))
8581 }
8682 } else {
87- files = addFile (files , path )
83+ if ! migrations .IsDown (path ) {
84+ files = append (files , path )
85+ }
8886 }
8987 }
9088 return files , nil
You can’t perform that action at this time.
0 commit comments