Skip to content

ExtensionMigrationPlan

Namespace: Ankus.PgConfig

Assembly: Ankus.PgConfig.dll

Describes the upgrade script that assembling the unreleased fragments writes, as pgrx’s migrate assemble and info plan it.

public sealed class ExtensionMigrationPlan

Inheritance: object

Create(ExtensionMigrationProject, string?, string?, string?)

Section titled “Create(ExtensionMigrationProject, string?, string?, string?)”

Plans the upgrade script, as pgrx’s migrate assemble and info do.

public static ExtensionMigrationPlan Create(ExtensionMigrationProject project, string? targetVersion = null, string? previousVersion = null, string? outputDirectory = null)

Parameters:

project — ExtensionMigrationProject

The project.

targetVersion — string

The version to upgrade to, or null for the extension’s version when it is newer than every script in sql/, or else the next patch.

previousVersion — string

The release to upgrade from, or null for the latest in sql/.

outputDirectory — string

The directory for the script, or null for sql/.

Returns: ExtensionMigrationPlan

The plan.

Exceptions:

Formats the plan as JSON.

public string ToJson()

Returns: string

The JSON.

Formats the plan for reading.

public string ToText()

Returns: string

The text.

Gets the extension’s name.

public string ExtensionName { get; }

Value: string

Gets the fragments’ file names, in assembly order.

public IReadOnlyList<string> FragmentNames { get; }

Value: IReadOnlyList<string>

Gets the fragments’ paths, in assembly order.

public IReadOnlyList<string> FragmentPaths { get; }

Value: IReadOnlyList<string>

Gets the script’s path.

public string OutputFile { get; }

Value: string

Gets the release the script upgrades from.

public string PreviousVersion { get; }

Value: string

Gets the script’s SQL.

public string Script { get; }

Value: string

Gets the version the script upgrades to.

public string TargetVersion { get; }

Value: string