# RunDatabaseUpdateOnStart

- Module: [Aspire.Hosting.EntityFrameworkCore](/reference/api/go/aspire.hosting.entityframeworkcore.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `method`
- Defined on: [`EFMigrationResource`](/reference/api/go/aspire.hosting.entityframeworkcore/efmigrationresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Configures the EF migration resource to run database update when the AppHost starts.

## Remarks

When enabled, migrations are applied during AppHost startup. This only affects local
run-mode execution. The migrations resource is not deployed with the app, so this method
has no effect during publish or deployment.
A health check is automatically registered for this resource, allowing other resources to use
`.WaitFor()` to wait until migrations complete before starting.

## Definition

```go
func (EFMigrationResource) RunDatabaseUpdateOnStart() EFMigrationResource
```

## Returns

[`EFMigrationResource`](/reference/api/go/aspire.hosting.entityframeworkcore/efmigrationresource.md) -- The resource builder for chaining.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`EFMigrationResource`](/reference/api/go/aspire.hosting.entityframeworkcore/efmigrationresource.md)
