File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/Illuminate/Database/Schema/Grammars Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,21 @@ class MySqlGrammar extends Grammar
43
43
*/
44
44
public function compileCreateDatabase ($ name , $ connection )
45
45
{
46
+ $ charset = $ connection ->getConfig ('charset ' );
47
+ $ collation = $ connection ->getConfig ('collation ' );
48
+
49
+ if (! $ charset || ! $ collation ) {
50
+ return sprintf (
51
+ 'create database %s ' ,
52
+ $ this ->wrapValue ($ name ),
53
+ );
54
+ }
55
+
46
56
return sprintf (
47
57
'create database %s default character set %s default collate %s ' ,
48
58
$ this ->wrapValue ($ name ),
49
- $ this ->wrapValue ($ connection -> getConfig ( ' charset ' ) ),
50
- $ this ->wrapValue ($ connection -> getConfig ( ' collation ' ) ),
59
+ $ this ->wrapValue ($ charset ),
60
+ $ this ->wrapValue ($ collation ),
51
61
);
52
62
}
53
63
You can’t perform that action at this time.
0 commit comments