コード例 #1
0
 private static string ZipFileName()
 {
     return
         (Environments.ServiceName + "_" +
          DateTimes.Full() + "_" +
          Environment.MachineName + ".zip");
 }
コード例 #2
0
 private static string SourceFilePath(string filePath)
 {
     return(filePath.DirectoryName() + @"\" +
            filePath.FileNameOnly() + "_" +
            DateTimes.Full() +
            filePath.FileExtension());
 }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
ファイル: Tables.cs プロジェクト: kazuca/Implem.Pleasanter
        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));
            }
        }
コード例 #5
0
 private static string HistoryFileName()
 {
     return("History_" + DateTimes.Full() + Environments.Guid + ".zip");
 }