rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.19k stars 273 forks source link

Unable to parse migration file #90

Closed stephen-kruger closed 6 years ago

stephen-kruger commented 7 years ago

Getting the error : Error while parsing 00000-dbatools.sql: Error parsing migration (00000-dbatools.sql): bufio.Scanner: token too long

I think your Scanner code needs to be initialised with a longer buffer than default : This should fix it : scanner := bufio.NewScanner(file) buf := make([]byte, 0, 64*1024) scanner.Buffer(buf, 1024*1024)

I can pm an offending migration file if required, prefer not to attach to ticket publicly.