You can try to add this
.ApplyAllDatabaseChangesOnStartup();
at the end of the AddMarten method. E.i:
// Marten configuration
builder.Services.AddMarten(options =>
{
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
options.Connection(connectionString);
options.AutoCreateSchemaObjects = AutoCreate.All;
// Document mappings
options.Schema.For<Baum>().Identity(x => x.Id);
options.Schema.For<Auftrag>().Identity(x => x.Id);
options.Schema.For<Baumart>().Identity(x => x.Id);
options.Schema.For<Gehölzdaten>().Identity(x => x.Id);
options.Schema.For<Koordinatentyp>();
options.Schema.For<Baumkontrolle>().ForeignKey<Auftrag>(x => x.AuftragId);
options.Schema.For<Baumpflege>().ForeignKey<Auftrag>(x => x.AuftragId);
})
.ApplyAllDatabaseChangesOnStartup();
References: https://martendb.io/schema/migrations.html#apply-all-outstanding-changes-upfront https://martendb.io/schema/#overriding-schema-name