EFMigrationResource
Handle
interface EFMigrationResource extends IComputeResource, IResource, IResourceWithArgs, IResourceWithEndpoints, IResourceWithEnvironment, IResourceWithProbes, IResourceWithWaitSupport { bundleBaseImage: string; bundleSelfContained: boolean; bundleTargetRuntime: string; readonly dbContextTypeName: string; migrationNamespace: string; migrationOutputDirectory: string; migrationsProjectPath: string; readonly projectResource: ProjectResource; publishBundleContainer: boolean; scriptIdempotent: boolean; scriptNoTransactions: boolean; readonly startupProjectResource: IDotnetProgramResource; publishAsMigrationBundle( targetRuntime?: string, selfContained?: boolean, publishContainer?: boolean, baseImage?: string): EFMigrationResource; publishAsMigrationScript( idempotent?: boolean, noTransactions?: boolean): EFMigrationResource; runDatabaseUpdateOnStart(): EFMigrationResource; withMigrationNamespace(namespace: string): EFMigrationResource; withMigrationOutputDirectory(outputDirectory: string): EFMigrationResource; withMigrationsProject(migrationsProject?: string | IDotnetProgramResource): EFMigrationResource;}27 members
Properties
property
bundleBaseImagestringget · setGets or sets the base container image for the migration bundle container.
property
bundleSelfContainedbooleanget · setGets or sets whether the migration bundle should be self-contained.
property
bundleTargetRuntimestringget · setGets or sets the target runtime identifier for the migration bundle (e.g., "linux-x64", "win-x64").
property
dbContextTypeNamestringgetGets the fully qualified name of the DbContext type to use for migrations, or null to auto-detect.
property
migrationNamespacestringget · setGets or sets the namespace for new migrations. Used by the Add Migration command.
property
migrationOutputDirectorystringget · setGets or sets the output directory for new migrations. Used by the Add Migration command.
property
migrationsProjectPathstringget · setGets or sets the path to the project containing the migrations, when it's not the same as the startup project.
property
projectResourceProjectResourcegetGets the parent project resource that contains the DbContext.
property
publishBundleContainerbooleanget · setGets or sets whether the migration bundle should be published as a container image that applies the migrations to the database at deploy time.
property
scriptIdempotentbooleanget · setGets or sets whether the migration script should be idempotent (include IF NOT EXISTS checks).
property
scriptNoTransactionsbooleanget · setGets or sets whether to omit transaction statements from the migration script.
property
startupProjectResourceIDotnetProgramResourcegetGets the startup .NET program resource that contains the DbContext configuration.
Methods
Configures the EF migration resource to generate a migration bundle during publishing.
publishAsMigrationBundle( targetRuntime?: string, selfContained?: boolean, publishContainer?: boolean, baseImage?: string): EFMigrationResourceParameters
targetRuntimestringoptionalselfContainedbooleanoptional= FalsepublishContainerbooleanoptional= FalsebaseImagestringoptionalReturns
EFMigrationResourceConfigures the EF migration resource to generate a migration script during publishing.
publishAsMigrationScript( idempotent?: boolean, noTransactions?: boolean): EFMigrationResourceParameters
idempotentbooleanoptional= TruenoTransactionsbooleanoptional= FalseReturns
EFMigrationResourceConfigures the EF migration resource to run database update when the AppHost starts.
runDatabaseUpdateOnStart(): EFMigrationResourceReturns
EFMigrationResourceConfigures the namespace for new migrations created with the Add Migration command.
withMigrationNamespace(namespace: string): EFMigrationResourceParameters
namespacestringReturns
EFMigrationResourceConfigures the output directory for new migrations created with the Add Migration command.
withMigrationOutputDirectory(outputDirectory: string): EFMigrationResourceParameters
outputDirectorystringReturns
EFMigrationResourceConfigures a separate project containing migrations for polyglot AppHosts.
withMigrationsProject(migrationsProject?: string | IDotnetProgramResource): EFMigrationResourceParameters
migrationsProjectstring | IDotnetProgramResourceoptionalReturns
EFMigrationResource