# EFMigrationResource.RunDatabaseUpdateOnStart

- Module: [Aspire.Hosting.EntityFrameworkCore](/reference/api/go/aspire.hosting.entityframeworkcore.md)
- Defined on: [EFMigrationResource](/reference/api/go/aspire.hosting.entityframeworkcore/efmigrationresource.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `method`

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
type EFMigrationResource interface {
    // ... omitted for brevity
    RunDatabaseUpdateOnStart() EFMigrationResource
}
```

## Signature

```go
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()`.

## Defined on

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