# The Migration object

A managed migration of PostgreSQL databases into a Lakebase branch.

## Attributes

- `name` (string, Beta, ID, Immutable)
  The migration resource name, in the format `migrations/{migration}`.
- `source_connection` (string, Beta)
  Required. The name of the Unity Catalog connection (a UC securable name, such as
   `my_postgres_connection`) used to connect to the source PostgreSQL server.
- `database_mappings` (array of object, Beta)
  Required. Mappings from source databases to target databases.
  - `source_database` (string, Beta)
    Required. The exact PostgreSQL database name on the source server.
  - `target_database` (string, Beta)
    The PostgreSQL database name to create on the target branch. When omitted, the source database
     name is preserved.
  - `effective_target_database` (string, Beta, Output only)
    Output-only. The resolved target PostgreSQL database name. Equal to `target_database` when
     provided; otherwise equal to `source_database`.
- `target_branch` (string, Beta)
  The Lakebase branch receiving the migrated databases, in the format
   `projects/{project_id}/branches/{branch_id}`. May be omitted during assessment, but must be
   set before the migration starts, and may be changed until then.
- `state` (string, Beta, Output only)
  Output-only. The authoritative migration lifecycle state.
  Possible values:
  - `MIGRATION_STATE_DRAFT`
  - `MIGRATION_STATE_ASSESSING`
  - `MIGRATION_STATE_ASSESSMENT_NEEDS_ACTION`
  - `MIGRATION_STATE_READY_TO_START`
  - `MIGRATION_STATE_SCHEMA_LOAD`
  - `MIGRATION_STATE_INITIAL_DATA_LOAD`
  - `MIGRATION_STATE_COMPLETED`
  - `MIGRATION_STATE_FAILED`
- `create_time` (string, Beta, Output only)
  Output-only. The time when the migration was created.
- `update_time` (string, Beta, Output only)
  Output-only. The time when the migration was last updated.
- `delete_time` (string, Beta, Output only)
  Output-only. The time when the migration was soft-deleted. Empty if the migration is active.
- `purge_time` (string, Beta, Output only)
  Output-only. The time when the soft-deleted migration is scheduled for permanent deletion.
   Empty if the migration is active or permanent deletion is not scheduled.
- `error` (object, Beta, Output only)
  Output-only. The current error preventing migration progress, if any.
  - `code` (string, Beta, Output only)
    A stable machine-readable error code.
  - `message` (string, Beta, Output only)
    A concise explanation of the failure.
- `migration_type` (string, Beta, Immutable)
  Required. Immutable. The intended migration mode, selected when the migration is created.
  Possible values:
  - `MIGRATION_TYPE_ONE_TIME_COPY`

## Example

```json
{
  "name": "string",
  "source_connection": "string",
  "database_mappings": [
    {
      "source_database": "string",
      "target_database": "string",
      "effective_target_database": "string"
    }
  ],
  "target_branch": "string",
  "state": "MIGRATION_STATE_DRAFT",
  "create_time": "string",
  "update_time": "string",
  "delete_time": "string",
  "purge_time": "string",
  "error": {
    "code": "string",
    "message": "string"
  },
  "migration_type": "MIGRATION_TYPE_ONE_TIME_COPY"
}
```


