mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
MINOR: catch wider range of create strings
This commit is contained in:
parent
30215cea6d
commit
d989c15a2a
@ -467,7 +467,7 @@ class SQLite3Database extends SS_Database {
|
|||||||
$fieldList = array();
|
$fieldList = array();
|
||||||
|
|
||||||
if($sqlCreate && $sqlCreate['sql']) {
|
if($sqlCreate && $sqlCreate['sql']) {
|
||||||
preg_match('/^[\s]*CREATE[\s]+TABLE[\s]+[\'"][a-zA-Z0-9_]+[\'"][\s]*\((.+)\)[\s]*$/ims', $sqlCreate['sql'], $matches);
|
preg_match('/^[\s]*CREATE[\s]+TABLE[\s]+[\'"]?[a-zA-Z0-9_]+[\'"]?[\s]*\((.+)\)[\s]*$/ims', $sqlCreate['sql'], $matches);
|
||||||
$fields = isset($matches[1]) ? preg_split('/,(?=(?:[^\'"]*$)|(?:[^\'"]*[\'"][^\'"]*[\'"][^\'"]*)*$)/x', $matches[1]) : array();
|
$fields = isset($matches[1]) ? preg_split('/,(?=(?:[^\'"]*$)|(?:[^\'"]*[\'"][^\'"]*[\'"][^\'"]*)*$)/x', $matches[1]) : array();
|
||||||
foreach($fields as $field) {
|
foreach($fields as $field) {
|
||||||
$details = preg_split('/\s/', trim($field));
|
$details = preg_split('/\s/', trim($field));
|
||||||
|
Loading…
Reference in New Issue
Block a user