Database Structure Options
Structure options control which parts of the target table definition DBConvert Streams creates when Create structure is enabled.
Use this page when:
- you want DBConvert Streams to create target tables for you
- you want to skip indexes, foreign keys, or check constraints during the initial run
- you need to understand what the advanced toggles in the wizard actually do
In the API, these settings live in target.spec.db.structureOptions.
How the UI works
In the stream wizard, the Structure & Data step has a master Create structure checkbox.
When that checkbox is enabled, you can open Advanced options and choose:
- Tables
- Indexes
- Foreign keys
- Check constraints
These toggles refine structure creation. They do not currently backfill indexes, foreign keys, or check constraints onto existing tables by themselves when table creation is off.
Options
| Label in UI | API field | What it affects during table creation | Ignored when |
|---|---|---|---|
| Tables | tables | Creates target tables when they do not exist. | Create structure is off. |
| Indexes | indexes | Creates primary keys, unique indexes, and secondary indexes as part of table materialization. | Create structure is off, or table creation is off. |
| Foreign keys | foreignKeys | Adds foreign key constraints after tables are created. | Create structure is off, or table creation is off. |
| Check constraints | checkConstraints | Includes check constraints in generated table DDL. | Create structure is off, or table creation is off. |
All four options default to true.
Common setups
| Goal | Tables | Indexes | Foreign keys | Check constraints |
|---|---|---|---|---|
| Strict schema copy | On | On | On | On |
| Faster initial load | On | Off | Off | On |
| DBA-managed existing schema | Off | Off | Off | Off |
| Create missing tables but avoid relationship enforcement | On | On | Off | On |
When to disable each option
| Option | Disable it when |
|---|---|
| Tables | The target schema is managed outside the stream and DBConvert Streams should only write data. |
| Indexes | You want to reduce write overhead during a large initial load and create indexes later. |
| Foreign keys | You want to avoid insert-order issues or reduce enforcement overhead during loading. |
| Check constraints | The source constraints use engine-specific expressions that may not translate cleanly. |
What does not happen
If Tables is off, the other toggles are not used as standalone “patch existing schema” actions for already-existing tables.
Use Target Schema and Data Policies with this page: structure options decide what to create, schema policy decides whether creation is allowed, and write mode decides what to do with existing rows.
API example
This example creates tables and check constraints, but skips indexes and foreign keys:
{
"target": {
"id": "conn_TARGET_ID",
"spec": {
"db": {
"database": "target_db",
"structureOptions": {
"tables": true,
"indexes": false,
"foreignKeys": false,
"checkConstraints": true
}
}
}
}
}
Verification
After you start the stream:
- confirm the stream reaches structure creation instead of stopping on schema policy validation
- if indexes or foreign keys are disabled, verify that the target tables exist without those extra objects
- if Tables is off, do not expect DBConvert Streams to backfill missing indexes or constraints onto existing tables
Related docs
- Target Schema and Data Policies — schema policy and write mode
- Stream Configuration Guide
- Stream Configuration Reference
- Table Structure Conversion — data type mapping between MySQL and PostgreSQL