# RunDatabaseUpdateOnStart

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

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)
