-
-
Save doctrinebot/8df5a3985d02170a5f6b to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-72 - https://github.com/doctrine/doctrine2/issues/5233
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: ConvertDoctrine1Schema.php | |
=================================================================== | |
--- ConvertDoctrine1Schema.php (revision 6580) | |
+++ ConvertDoctrine1Schema.php (working copy) | |
@@ -143,6 +143,11 @@ | |
$column = array(); | |
$column['type'] = $string; | |
} | |
+ // check if a column alias was used (column_name as field_name) | |
+ if (preg_match("/(\w+)\sas\s(\w+)/i", $name, $matches)) { | |
+ $name = $matches[1]; | |
+ $column['alias'] = $matches[2]; | |
+ } | |
if (preg_match("/([a-zA-Z]+)\(([0-9]+)\)/", $column['type'], $matches)) { | |
$column['type'] = $matches[1]; | |
$column['length'] = $matches[2]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment