# amfelt deploy

Deploy a data contract to a target database.

Deploys an ODCS data contract to a target database using the configured target
plugin. The target must be defined in the project's amfelt.yaml file. The
command generates DDL statements (CREATE TABLE, etc.) from the contract and
executes them against the target database.

Use `--dry-run` to preview the generated DDL without executing it.

## Usage

```text
amfelt deploy <target-name> [flags]
```

## Examples

```text
deploy dwh --contract contracts/adventureworks.odcs.yaml
Deploys the adventureworks contract to the 'dwh' target defined in amfelt.yaml.

deploy dwh --contract contracts/sales.odcs.yaml --dry-run
Generates DDL for the sales contract without executing it.

deploy dwh --contract contracts/users.odcs.yaml --install
Deploys with auto-installation of the target plugin if not already installed.
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `-c`, `--contract` | `string` | — | path to the ODCS contract file to deploy |
| `--dry-run` | `bool` | `false` | generate DDL without executing against the database |
| `--force` | `bool` | `false` | ignore warnings and errors |
| `--history-mode` | `string` | `scd2` | history table accumulation strategy; one of scd2, snapshot, append, scd1 |
| `--include` | `string` | — | object selection glob(s) over the source contract for a select job; comma-separated (default *) |
| `--install` | `bool` | `false` | automatically install the required plugins |
| `--layer` | `string` | `all` | pipeline layer to deploy; one of staging, history, bridge, business, all |
| `--path` | `string` | `amfelt.yaml` | path of the Amfelt project file |
| `--schema-prefix` | `string` | — | base schema prefix override (e.g. "myproject" → myproject_stg, myproject_hst); overrides the PCF's job.schemaPrefix, falls back to "amfelt" if neither is set |
{.clidoc-flags-table}

## Global flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--amfelt-dir` | `string` | `.amfelt` | directory for workspace files (such as plugins); does not move agent identity (controlled by AMFELT_DIR) |
| `--config` | `string` | — | directory or filename of the application configuration |
| `-f`, `--format` | `string` | `default` | log format to use; either default, pretty, or json |
| `-l`, `--level` | `string` | `info` | minimum log level to display; either error, warn, info, or debug |
| `-v`, `--verbose` | `bool` | `false` | trigger to use verbose logging |
{.clidoc-flags-table}

---

Generated from `amfelt` v5.6.3.
