public void Create_and_initialize_operation() { var moveTableOperation = new MoveTableOperation("dbo.MyTable", "dbo2"); Assert.Equal("dbo.MyTable", moveTableOperation.TableName); Assert.Equal("dbo2", moveTableOperation.NewSchema); Assert.False(moveTableOperation.IsDestructiveChange); }
public void Dispatches_visitor() { var moveTableOperation = new MoveTableOperation("dbo.MyTable", "dbo2"); var mockVisitor = new Mock<MigrationOperationSqlGenerator>(new RelationalTypeMapper()); var builder = new Mock<IndentedStringBuilder>(); moveTableOperation.GenerateSql(mockVisitor.Object, builder.Object); mockVisitor.Verify(g => g.Generate(moveTableOperation, builder.Object), Times.Once()); }
public virtual void Visit([NotNull] MoveTableOperation moveTableOperation, [NotNull] TContext context) { VisitDefault(moveTableOperation, context); }
public void Generate_with_move_table_works() { var operation = new MoveTableOperation("my.Pony", "bro"); var sql = Generate(operation); Assert.Equal("ALTER TABLE \"my.Pony\" RENAME TO \"bro.Pony\"", sql); }
public override void Generate(MoveTableOperation moveTableOperation, IndentedStringBuilder stringBuilder) { Check.NotNull(moveTableOperation, "moveTableOperation"); Check.NotNull(stringBuilder, "stringBuilder"); GenerateRenameTable( moveTableOperation.TableName, new SchemaQualifiedName(moveTableOperation.TableName.Name, moveTableOperation.NewSchema), stringBuilder); }