You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a bug report, but a feature request.
Current implementation always parse all of sql files, so may require a lot of time and memory if there are too many files or too big files in directory. But, in most of cases, we only need to parse 1~3 files because sort byId does not need content of files, it needs only the name of files.
So, I think it is better to parse sql files only when we need content of files.
It seems to me that the best way to achieve this would be as follows
type Migration struct {
Id string
// private field from here
up []string
down []string
disableTransactionUp bool
disableTransactionDown bool
path string
parsed bool
}
func (m *Migration) Up() []string {
if !m.parsed {
// call sqlparse.ParseMigration(r) and save results.
m.parsed = true
}
return m.up
}
If it's okay, I can send PR.
The text was updated successfully, but these errors were encountered:
This is not a bug report, but a feature request.
Current implementation always parse all of sql files, so may require a lot of time and memory if there are too many files or too big files in directory. But, in most of cases, we only need to parse 1~3 files because sort
byId
does not need content of files, it needs only the name of files.So, I think it is better to parse sql files only when we need content of files.
It seems to me that the best way to achieve this would be as follows
If it's okay, I can send PR.
The text was updated successfully, but these errors were encountered: