Ejemplo n.º 1
0
        public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
        {
            Check.NotNull(row, nameof(row));

            // TODO: Escape. Can we parameterize?
            return(new SqlOperation(
                       @"INSERT INTO [dbo].[__MigrationHistory] ([MigrationId], [ContextKey], [ProductVersion])
VALUES ('" + row.MigrationId + "', '" + _contextType.FullName + "', '" + row.ProductVersion + "')",
                       suppressTransaction: false));
        }
Ejemplo n.º 2
0
 public virtual MigrationOperation GetInsertOperation(IHistoryRow row) => new SqlOperation
 {
     Sql = new IndentedStringBuilder().Append("INSERT INTO ")
           .Append(_sql.DelimitIdentifier(MigrationTableName))
           .Append(" (\"MigrationId\", \"ContextKey\", \"ProductVersion\") VALUES (")
           .Append($"'{_sql.EscapeLiteral(row.MigrationId)}', ")
           .Append($"'{_sql.EscapeLiteral(_contextKey)}', ")
           .Append($"'{_sql.EscapeLiteral(row.ProductVersion)}'")
           .Append(");")
           .ToString()
 };
Ejemplo n.º 3
0
        public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
        {
            Check.NotNull(row, nameof(row));

            return(new SqlOperation
            {
                Sql = new StringBuilder()
                      .AppendLine("INSERT INTO [dbo].[__MigrationHistory] ([MigrationId], [ContextKey], [ProductVersion])")
                      .Append("VALUES ('").Append(_sql.EscapeLiteral(row.MigrationId)).Append("', '")
                      .Append(_sql.EscapeLiteral(_contextType.FullName)).Append("', '")
                      .Append(_sql.EscapeLiteral(row.ProductVersion)).AppendLine("');")
                      .ToString()
            });
        }
        public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
        {
            Check.NotNull(row, nameof(row));

            return new SqlOperation
                {
                    Sql = new StringBuilder()
                        .AppendLine("INSERT INTO [dbo].[" + MigrationHistoryTableName + "] ([MigrationId], [ContextKey], [ProductVersion])")
                        .Append("VALUES ('").Append(_sql.EscapeLiteral(row.MigrationId)).Append("', '")
                        .Append(_sql.EscapeLiteral(_contextType.FullName)).Append("', '")
                        .Append(_sql.EscapeLiteral(row.ProductVersion)).AppendLine("');")
                        .ToString()
                };
        }
 public MigrationOperation GetInsertOperation(IHistoryRow row) => null;
Ejemplo n.º 6
0
 public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
 {
     throw new NotImplementedException();
 }
 public virtual MigrationOperation GetInsertOperation(IHistoryRow row)
 {
     throw new NotImplementedException();
 }
 public virtual MigrationOperation GetInsertOperation(IHistoryRow row) => new SqlOperation
 {
     Sql = new IndentedStringBuilder().Append("INSERT INTO ")
         .Append(_sql.DelimitIdentifier(MigrationTableName))
         .Append(" (\"MigrationId\", \"ContextKey\", \"ProductVersion\") VALUES (")
         .Append($"'{_sql.EscapeLiteral(row.MigrationId)}', ")
         .Append($"'{_sql.EscapeLiteral(_contextKey)}', ")
         .Append($"'{_sql.EscapeLiteral(row.ProductVersion)}'")
         .Append(");")
         .ToString()
 };