> For the complete documentation index, see [llms.txt](https://cloakedkeys.gitbook.io/ofsc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cloakedkeys.gitbook.io/ofsc/page/schema.md).

# Schema

For the complete, generated list of tables and columns, see [Database tables](/ofsc/reference/database.md) in the Technical Reference.

## Schemas

The schema may be extended in future versions, but existing columns will remain for backwards compatibility.

Table rebuilds during migration and the Merge Databases menu keep every row, including `is_deleted`. A rebuild runs in one transaction, so if it fails the old table is left intact.

### Labels

* **id:** INTEGER NOT NULL PRIMARY KEY
* **label\_id:** INTEGER
* **name:** VARCHAR
* **type:** VARCHAR
* **post\_id:** INTEGER
* **model\_id:** INTEGER
* **UNIQUE (post\_id, label\_id, model\_id)**

### Medias

* **model\_id**: INTEGER
* **hash**: VARCHAR
* **unlocked**: BOOL
* **duration**: VARCHAR
* **posted\_at**: TIMESTAMP
* **created\_at**: TIMESTAMP
* **downloaded**: BOOL
* **linked**: BOOL
* **preview**: INTEGER
* **media\_type**: VARCHAR
* **api\_type**: VARCHAR
* **size**: INTEGER
* **filename**: VARCHAR
* **directory**: VARCHAR
* **link**: VARCHAR
* **post\_id**: INTEGER NOT NULL
* **media\_id**: INTEGER
* **id**: INTEGER NOT NULL PRIMARY KEY
* **UNIQUE (media\_id, model\_id, post\_id)**

### Messages

* **model\_id:** INTEGER
* **user\_id:** INTEGER
* **created\_at:** TIMESTAMP
* **archived:** BOOLEAN
* **paid:** BOOLEAN
* **price:** INTEGER
* **text:** VARCHAR
* **post\_id:** INTEGER NOT NULL
* **id:** INTEGER NOT NULL PRIMARY KEY
* **is\_deleted:** BOOLEAN DEFAULT 0
* **UNIQUE (post\_id, model\_id)**

### **Posts**

* **model\_id:** INTEGER
* **created\_at** :TIMESTAMP
* **opened:** BOOLEAN
* **stream:** BOOLEAN
* **pinned:** BOOLEAN
* **archived:** BOOLEAN
* **paid:** INTEGER
* **price:** INTEGER
* **text:** VARCHAR
* **post\_id:** INTEGER NOT NULL
* **id:** INTEGER NOT NULL PRIMARY KEY
* **is\_deleted:** BOOLEAN DEFAULT 0
* **UNIQUE** (**post\_id**, **model\_id**)

### Stories

* **model\_id:** INTEGER
* **created\_at:** TIMESTAMP
* **archived:** BOOLEAN
* **paid:** INTEGER
* **price:** INTEGER
* **text:** VARCHAR
* **post\_id:** INTEGER NOT NULL
* **id:** INTEGER NOT NULL PRIMARY KEY
* **UNIQUE (post\_id, model\_id)**

### Models

* **id:** INTEGER NOT NULL PRIMARY KEY
* **model\_id:** INTEGER NOT NULL
* **UNIQUE model\_id**

### Profiles

* **username**: VARCHAR NOT NULL
* **user\_id**: INTEGER NOT NULL
* **id**: INTEGER NOT NULL PRIMARY KEY
* **UNIQUE (user\_id, username)**

### Products

Legacy table; nothing writes to it now.

* **id**: INTEGER NOT NULL PRIMARY KEY
* **post\_id**: INTEGER NOT NULL
* **model\_id**: INTEGER
* **title**: VARCHAR
* **created\_at**: TIMESTAMP
* **archived**: BOOLEAN
* **paid**: INTEGER
* **price**: INTEGER
* **text**: VARCHAR
* **UNIQUE (post\_id, model\_id)**

### Others

Legacy table; nothing writes to it now.

* **`id`**: INTEGER, NOT NULL, PRIMARY KEY
* **`post_id`**: INTEGER, NOT NULL
* **`text`:** VARCHAR
* **`price`:** INTEGER
* **`paid`:** INTEGER
* **`archived`:** BOOLEAN
* **`created_at`:** TIMESTAMP
* **`model_id`:** INTEGER
* **UNIQUE (post\_id, model\_id)**

### **Schema\_flags**

* **flag\_name:** TEXT PRIMARY KEY
* **flag\_value:** TEXT

Fansly databases also have a row `site` = `fansly`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cloakedkeys.gitbook.io/ofsc/page/schema.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
