protected override void Generate(DropSchemaOperation operation, IModel model, MigrationCommandListBuilder builder) { builder .Append("DROP KEYSPACE ") .Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(operation.Name)) .AppendLine(Dependencies.SqlGenerationHelper.StatementTerminator); EndStatement(builder); }
public static OperationBuilderSurface <DropSchemaOperation> DropSchema(this IMigrationBuilder builder, string name, string catalog = null) { var op = new DropSchemaOperation { Name = new ObjectName(catalog, name, null) }; builder.AddOperation(op); return(new OperationBuilderSurface <DropSchemaOperation>(op)); }
public virtual void Generate( [NotNull] DropSchemaOperation operation, [CanBeNull] IModel model, [NotNull] SqlBatchBuilder builder) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); builder .Append("DROP SCHEMA ") .Append(_sql.DelimitIdentifier(operation.Name)); }
protected virtual void Generate( [NotNull] DropSchemaOperation operation, [CanBeNull] IModel model, [NotNull] RelationalCommandListBuilder builder) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); builder .Append("DROP SCHEMA ") .Append(SqlGenerator.DelimitIdentifier(operation.Name)); }
public virtual OperationBuilder <DropSchemaOperation> DropSchema(string name) { Check.NotEmpty(name, nameof(name)); var operation = new DropSchemaOperation { Name = name }; Operations.Add(operation); return(new OperationBuilder <DropSchemaOperation>(operation)); }
/// <summary> /// 删除架构。 /// </summary> /// <param name="operation">操作实例。</param> /// <param name="builder"><see cref="MigrationCommandListBuilder"/>实例对象。</param> protected virtual void Generate( [NotNull] DropSchemaOperation operation, [NotNull] MigrationCommandListBuilder builder) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); builder .Append("DROP SCHEMA ") .Append(SqlHelper.DelimitIdentifier(operation.Name)) .AppendLine(SqlHelper.StatementTerminator); EndStatement(builder); }
protected virtual void Generate([NotNull] DropSchemaOperation operation, [NotNull] IndentedStringBuilder builder) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); builder .Append(".DropSchema(") .Append(_code.Literal(operation.Name)) .Append(")"); using (builder.Indent()) { Annotations(operation.Annotations, builder); } }
public void When_Drop_Schema_Then_CQL_Is_Returned() { var dropSchemaOperation = new DropSchemaOperation { Name = "cv" }; var fakeDbContext = (IInfrastructure <IServiceProvider>) new FakeDbContext((modelBuilder) => { modelBuilder.Entity <Applicant>() .ToTable("applicants") .HasKey(p => p.Id); }); var migrationsSqlGenerator = (IMigrationsSqlGenerator)fakeDbContext.Instance.GetService(typeof(IMigrationsSqlGenerator)); var result = migrationsSqlGenerator.Generate(new[] { dropSchemaOperation }); Assert.Equal("DROP KEYSPACE \"cv\";\r\n", result.First().CommandText); }
protected override void Generate(DropSchemaOperation operation, IModel model, MigrationCommandListBuilder builder) { }
protected override void Generate(DropSchemaOperation operation, IModel model, MigrationCommandListBuilder builder) => throw new NotSupportedException("Schemas are not supported by Firebird.");
protected override void Generate(DropSchemaOperation operation, IModel model, MigrationCommandListBuilder builder) { Check.NotNull(operation, nameof(operation)); Check.NotNull(builder, nameof(builder)); }
protected override void Generate(DropSchemaOperation operation, IModel model, MigrationCommandListBuilder builder) { throw new NotSupportedException(SqliteStrings.SchemasNotSupported); }
protected override void Generate(DropSchemaOperation operation, IModel model, SqlBatchBuilder builder) { throw new NotSupportedException(Strings.SchemasNotSupported); }
protected override void Generate(DropSchemaOperation operation, IModel model, RelationalCommandListBuilder builder) { throw new NotSupportedException("SQL Server Compact does not support schemas."); }