1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- using OASystem.Domain.Entities;
- using OASystem.Domain.Entities.Customer;
- using OASystem.Domain.Entities.Groups;
- using OASystem.Domain.Entities.Resource;
- using OASystem.Domain.Entities.System;
- using SqlSugar;
- var db = new SqlSugarClient(new ConnectionConfig()
- {
- ConnectionString = "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2023DB;",
- DbType = SqlSugar.DbType.SqlServer,
- IsAutoCloseConnection = true,
- InitKeyType = InitKeyType.Attribute
- });
- #region Aop
- #endregion
- #region 对话框
- Console.WriteLine("是否确定同步数据库表结构?(同名数据表将会被备份,生产环境慎用,回车确认)");
- var str = Console.ReadKey();
- if (str.Key == ConsoleKey.Enter)
- {
- Console.WriteLine("同步中,请稍后...");
- }
- else
- {
- Console.WriteLine("\r\n输入错误,已退出...");
- return;
- }
- #endregion
- db.DbMaintenance.CreateDatabase();
- db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- typeof(Res_ItemDetailInfo),
- typeof(Res_ItemVendor)
- });
- Console.WriteLine("数据库结构同步完成!");
|