# Is there a document introducing the database schema design?

**URL:** https://meta.discourse.org/t/is-there-a-document-introducing-the-database-schema-design/171729
**Category:** Development
**Created:** [November 30, 2020, 12:57pm UTC](https://meta.discourse.org/t/is-there-a-document-introducing-the-database-schema-design/171729 "2020-11-30T12:57:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![xdzhang](https://avatars.discourse-cdn.com/v4/letter/x/d9b06d/32.png) [@xdzhang](https://meta.discourse.org/u/xdzhang)
#### Post date: [November 30, 2020, 12:57pm UTC](https://meta.discourse.org/t/is-there-a-document-introducing-the-database-schema-design/171729/1 "2020-11-30T12:57:40Z")

</div>

I’m study how discourse was implemented, and I hope to understand each fields in schemas of discourse database, so that I can quickly know the meaning of things done by ruby codes.Is there a suite document for me?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [November 30, 2020, 1:10pm UTC](https://meta.discourse.org/t/is-there-a-document-introducing-the-database-schema-design/171729/2 "2020-11-30T13:10:20Z")

</div>

The best source of schema information is probably the annotations at the bottom of fiiles in the [`app/models`](https://github.com/discourse/discourse/tree/master/app/models) directory. For example, the `posts` table columns are

> <https://github.com/discourse/discourse/blob/e7bad9f05d70db666f992b55e024d77ead6db030/app/models/post.rb#L1109-L1162>

---

<div class="post-metadata">

### Author: ![TallTrees](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/talltrees/32/208620_2.png) [@TallTrees](https://meta.discourse.org/u/TallTrees)
#### Post date: [November 30, 2020, 2:29pm UTC](https://meta.discourse.org/t/is-there-a-document-introducing-the-database-schema-design/171729/3 "2020-11-30T14:29:45Z")

</div>

The [Discourse Data Explorer](https://meta.discourse.org/t/data-explorer-plugin/32566) might be worth a look too. It has the tables and columns listed out.

---

<div class="post-metadata">

### Author: ![tyler.lamparter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tyler.lamparter/32/485862_2.png) [@tyler.lamparter](https://meta.discourse.org/u/tyler.lamparter)
#### Post date: [January 23, 2025, 5:06am UTC](https://meta.discourse.org/t/is-there-a-document-introducing-the-database-schema-design/171729/4 "2025-01-23T05:06:53Z")

</div>

Been a while here, but if you have the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) Plugin, you can also use the api to fetch everything: `/admin/plugins/explorer/schema.json`.
