> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to customize the data model

> Add fields to existing common tables and create new tables and joins using the IModelConfigurer Java API.

Customize the default data model via the Java API:

* Add fields to existing tables
* Add new tables and joins.

## How to add a field to an existing table?

Use `IModelConfigurer.configureDatabase()` to add fields to an existing table. For example, to add a `Region` field to the `TradeAttributes` table:

```java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
final FieldDescription regionField =
    FieldDescription.builder().name("Region").dataType(STRING).build();
// In IModelConfigurer.configureDatabase():
databaseConfigurator.table(TRADE_ATTRIBUTES_TABLE).addField(regionField);
```

The `table()` method returns an `ITableConfigurator` that supports adding fields, modifying field properties, or configuring partitioning after the default schema is built.

## How to add a new table?

Add new tables in the `IModelConfigurer.configureDatabase()` method using `databaseConfigurator.addTable()`:

Call this inside `IModelConfigurer.configureDatabase()`:

```java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
databaseConfigurator.addTable(
    StartBuilding.store()
        .withStoreName("CustomRisk")
        .withField(AS_OF_DATE_FIELD)
        .asKeyField()
        .withField(TRADE_ID_FIELD)
        .asKeyField()
        .withField("RiskCategory", STRING)
        .withField("RiskWeight", DOUBLE)
        .build());
```

## How are joins and further customizations configured?

Joins between tables (`IDatabaseConfigurator.addJoin()` with a `ReferenceDescription`), field-type changes (`ITableConfigurator.changeField()`), and default-value changes (`ITableConfigurator.withDefaultValue()`) are configured through the Atoti Configuration API.

> For details and Java examples, see the [database configuration reference](../../../foundry/database).

## Related pages

* [Database model](./database-model)
