rails/rails — pull request #7088 by mdominiak (2012-07-18 10:53:48+00:00)
Title: fix sqlite3 column default containing newline character

Due to incorrect parsing of sqlite3 string column default containing newline character, any string column default containing newline character, e.g. "\n" or "\nRegards\nMatt" is parsed incorrectly by sqlite3 adapter and as a result contains enclosing quote characters ('), e.g. "'\n'" or "'\nRegards\nMatt'".

The regular expressions stripping column defaults out of enclosing quote/double quote characters did not take into consideration column defaults containing newline characters. More specifically /^(.)*$/ regular expression would not match "'\n'" since dot (.) in this expression is intended to match any character except for newline character and hence column default was not stripped correctly out of enclosing quotes returned by database when querying for table structure.