mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update SqlServer db.CreateDatabase
This commit is contained in:
parent
260678fe03
commit
096c258614
@ -465,6 +465,7 @@ namespace SqlSugar
|
||||
});
|
||||
if (!GetDataBaseList(newDb).Any(it => it.Equals(databaseName, StringComparison.CurrentCultureIgnoreCase)))
|
||||
{
|
||||
var separatorChar = UtilMethods.GetSeparatorChar();
|
||||
var sql = CreateDataBaseSql;
|
||||
if (databaseDirectory.HasValue())
|
||||
{
|
||||
@ -491,6 +492,7 @@ namespace SqlSugar
|
||||
maxsize = 1gb,
|
||||
filegrowth = 10mb
|
||||
); ";
|
||||
databaseDirectory = databaseDirectory.Replace("\\", separatorChar);
|
||||
}
|
||||
if (databaseName.Contains("."))
|
||||
{
|
||||
|
@ -4,6 +4,7 @@ using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
@ -16,6 +17,10 @@ namespace SqlSugar
|
||||
{
|
||||
public class UtilMethods
|
||||
{
|
||||
public static string GetSeparatorChar()
|
||||
{
|
||||
return Path.Combine("a", "a").Replace("a", "");
|
||||
}
|
||||
public static bool IsParentheses(object name)
|
||||
{
|
||||
return name.ObjToString().Trim().Last() == ')' && name.ObjToString().Trim().First() == '(';
|
||||
|
Loading…
Reference in New Issue
Block a user