namespace IStation.DAL
{
public class DbInitial
{
///
/// 初始数据库
///
///
///
///
public static bool InitTables(bool backup = false, int stringDefaultLength = 250)
{
var db = ConfigHelper.GetSqlSugarClient();
if (db == null)
return false;
Type[] types = new Type[] {
// typeof(Entity.ScheduleCombine),
typeof(Entity.ScheduleCombineLog),
typeof(Entity.ScheduleAnaLog),
};
db.DbMaintenance.CreateDatabase();
if (backup)
{
db.CodeFirst.BackupTable().InitTables(types);
}
else
{
db.CodeFirst.InitTables(types);
}
return true;
}
}
}