# Portfolios and document assignments

<a id="database.mappe"></a>

## mappe

> **Warning:** This page was automatically generated from the database schema dump and may be incomplete or incorrect.

Portfolio master data. A portfolio is a logical, cross-user collection of DMS objects — comparable to a favourites list or a working folder.

### Columns

| Name | Type | Length | Description |
|---|---|---|---|
| `id` | `int` | — | Portfolio ID (primary key). |
| `loeschen` | `smallint` | — | Delete marker (for staged deletion). |
| `zeitstempel` | `int` | — | Timestamp of the last change (UNIX time). |
| `angelegt` | `datetime` | — | Creation date. |
| `anleger` | `nvarchar` | 255 | User name of the creator. |
| `empfaenger` | `nvarchar` | 255 | Recipient/addressee of the portfolio (for handover portfolios). |
| `thema` | `nvarchar` | 32 | Subject/title of the portfolio. |
| `typ` | `smallint` | — | Portfolio type. |
| `links` | `smallint` | — | Link count. |
| `anleger_id` | `int` | — | ID of the creator. References [benutzer.id](users_and_groups.md#database.benutzer). |
| `empfaenger_id` | `int` | — | ID of the recipient. References [benutzer.id](users_and_groups.md#database.benutzer). |
| `deleted` | `int` | — | Final delete marker. |
| `osobjtypeguid` | `nvarchar` | 32 | GUID of the portfolio object type. |
| `usercol` | `nvarchar` | 255 | User-defined column for free data. |

### Related tables

* [mdrel](portfolios_and_document_assignments.md#database.mdrel) — assignment of documents to the portfolio.

### Usage by Server-API jobs

* [dms.AddPortfolio](../dms.md#dms.AddPortfolio), [dms.DelPortfolio](../dms.md#dms.DelPortfolio), [dms.ModPortfolio](../dms.md#dms.ModPortfolio) — portfolio CRUD.
* [dms.RetrievePortfolios](../dms.md#dms.RetrievePortfolios), [dms.RemoveFromPortfolio](../dms.md#dms.RemoveFromPortfolio).

<a id="database.mdrel"></a>

## mdrel

> **Warning:** This page was automatically generated from the database schema dump and may be incomplete or incorrect.

Mapping table between portfolios and documents. One row per document membership in a portfolio.

### Columns

| Name | Type | Length | Description |
|---|---|---|---|
| `loeschen` | `smallint` | — | Delete marker. |
| `zeitstempel` | `int` | — | Timestamp of the last change (UNIX time). |
| `mappe_id` | `int` | — | Portfolio ID. References [mappe.id](portfolios_and_document_assignments.md#database.mappe). |
| `object_id` | `int` | — | Object ID (the included document). References `objectX.id`. |
| `stamm_id` | `int` | — | Master-file ID of the object. References `stammX.id`. |
| `objekttyp` | `int` | — | Object-type ID of the included object. |
| `modul` | `smallint` | — | Module identifier (origin of the assignment). |
| `eingang` | `int` | — | Inbound reference (target reference). |
| `absender` | `int` | — | Sender ID. |
| `ausgang` | `int` | — | Outbound reference (source reference). |
| `anzahl` | `smallint` | — | Count marker. |
| `deleted` | `int` | — | Final delete marker. |
| `server_id` | `int` | — | Home server ID of the object. |
| `filesize` | `bigint` | — | Denormalised file size (bytes). |
| `mimetypeid` | `int` | — | Denormalised MIME-type ID. |
| `docpagecount` | `int` | — | Denormalised page count of the document. |

### Related tables

* [mappe](portfolios_and_document_assignments.md#database.mappe) — the portfolio.
* [Object tables](hierarchical_object_types.md#database.object) — the assigned document.
