private static string ZipFileName() { return (Environments.ServiceName + "_" + DateTimes.Full() + "_" + Environment.MachineName + ".zip"); }
private static string SourceFilePath(string filePath) { return(filePath.DirectoryName() + @"\" + filePath.FileNameOnly() + "_" + DateTimes.Full() + filePath.FileExtension()); }
internal static void MigrateTable( ISqlObjectFactory factory, string generalTableName, string sourceTableName, Sqls.TableTypes tableType, IEnumerable <ColumnDefinition> columnDefinitionCollection, IEnumerable <IndexInfo> tableIndexCollection) { Consoles.Write(generalTableName, Consoles.Types.Info); var destinationTableName = DateTimes.Full() + "_" + sourceTableName; CreateTable( factory: factory, generalTableName: generalTableName, sourceTableName: sourceTableName, tableType: tableType, columnDefinitionCollection: columnDefinitionCollection, tableIndexCollection: tableIndexCollection, rdsColumnCollection: null, tableNameTemp: destinationTableName); if (Def.ExistsTable(generalTableName, o => o.Identity && !sourceTableName.EndsWith("_history") && !sourceTableName.EndsWith("_deleted"))) { Def.SqlIoByAdmin(factory: factory).ExecuteNonQuery( factory: factory, dbTransaction: null, dbConnection: null, commandText: MigrateSql( factory: factory, sql: Def.Sql.MigrateTableWithIdentity, columnDefinitionCollection: columnDefinitionCollection, sourceTableName: sourceTableName, destinationTableName: destinationTableName)); } else { Def.SqlIoByAdmin(factory: factory).ExecuteNonQuery( factory: factory, dbTransaction: null, dbConnection: null, commandText: MigrateSql( factory: factory, sql: Def.Sql.MigrateTable, columnDefinitionCollection: columnDefinitionCollection, sourceTableName: sourceTableName, destinationTableName: destinationTableName)); } }
internal static void MigrateTable( string generalTableName, string sourceTableName, Sqls.TableTypes tableType, IEnumerable <ColumnDefinition> columnDefinitionCollection, IEnumerable <IndexInfo> tableIndexCollection) { Consoles.Write(generalTableName, Consoles.Types.Info); var destinationTableName = DateTimes.Full() + "_" + sourceTableName; CreateTable( generalTableName, sourceTableName, tableType, columnDefinitionCollection, tableIndexCollection, null, destinationTableName); if (Def.ExistsTable(generalTableName, o => o.Identity && !sourceTableName.EndsWith("_history") && !sourceTableName.EndsWith("_deleted"))) { Def.SqlIoByAdmin().ExecuteNonQuery( MigrateSql( Def.Sql.MigrateTableWithIdentity, columnDefinitionCollection, sourceTableName, destinationTableName)); } else { Def.SqlIoByAdmin().ExecuteNonQuery( MigrateSql( Def.Sql.MigrateTable, columnDefinitionCollection, sourceTableName, destinationTableName)); } }
private static string HistoryFileName() { return("History_" + DateTimes.Full() + Environments.Guid + ".zip"); }