Skip to main content

migrations

Creates, updates, deletes, gets or lists a migrations resource.

Overview

Namemigrations
TypeResource
Idazure.postgresql.migrations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
locationstringThe geo-location where the resource lives
propertiesobjectMigration resource properties.
tagsobjectResource tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, targetDbServerName, migrationNameGets details of a migration.
list_by_target_serverselectsubscriptionId, resourceGroupName, targetDbServerNamemigrationListFilterList all the migrations on a given target server.
createinsertsubscriptionId, resourceGroupName, targetDbServerName, migrationNameCreates a new migration.
updateupdatesubscriptionId, resourceGroupName, targetDbServerName, migrationNameUpdates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions.
deletedeletesubscriptionId, resourceGroupName, targetDbServerName, migrationNameDeletes a migration.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
migrationNamestringThe name of the migration.
resourceGroupNamestringThe resource group name of the target database server.
subscriptionIdstringThe subscription ID of the target database server.
targetDbServerNamestringThe name of the target database server.
migrationListFilterstringMigration list filter. Retrieves either active migrations or all migrations.

SELECT examples

Gets details of a migration.

SELECT
location,
properties,
tags
FROM azure.postgresql.migrations
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND targetDbServerName = '{{ targetDbServerName }}' -- required
AND migrationName = '{{ migrationName }}' -- required
;

INSERT examples

Creates a new migration.

INSERT INTO azure.postgresql.migrations (
data__properties,
data__tags,
data__location,
subscriptionId,
resourceGroupName,
targetDbServerName,
migrationName
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ location }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ targetDbServerName }}',
'{{ migrationName }}'
RETURNING
location,
properties,
tags
;

UPDATE examples

Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions.

UPDATE azure.postgresql.migrations
SET
data__properties = '{{ properties }}',
data__tags = '{{ tags }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND targetDbServerName = '{{ targetDbServerName }}' --required
AND migrationName = '{{ migrationName }}' --required
RETURNING
location,
properties,
tags;

DELETE examples

Deletes a migration.

DELETE FROM azure.postgresql.migrations
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND targetDbServerName = '{{ targetDbServerName }}' --required
AND migrationName = '{{ migrationName }}' --required
;