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)); }
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() };
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;
public virtual MigrationOperation GetInsertOperation(IHistoryRow row) { throw new NotImplementedException(); }