AIGCS

Database Schema

Database tables and relationships

Overview

AIGCS uses Drizzle ORM with SQLite as the database.

Tables

system_config

Global system configuration (single row, id = 'global').

ColumnTypeDescription
idtextPrimary key ('global')
smtp_hosttextSMTP server
smtp_portintegerSMTP port
smtp_usertextSMTP username
smtp_passtextEncrypted password
jwt_secrettextJWT signing key
allowed_originstextCORS origins (JSON)
registration_openinteger0/1 toggle
site_titletextSite title
site_favicontextFavicon URL

users

User accounts.

ColumnTypeDescription
idtextUUID
emailtextUnique email
usernametextUnique username
display_nametextDisplay name
password_hashtextArgon2id hash
roletextadmin or user
avatartextAvatar file extension

api_tokens

API access tokens.

ColumnTypeDescription
idtextUUID
user_idtextForeign key → users
nametextToken label
token_hashtextSHA-256 hash
scopetextread, read_write, or admin
expires_attextOptional expiry

sites

Multi-tenant sites.

ColumnTypeDescription
idtextUUID
user_idtextForeign key → users
domaintextSite domain
nametextSite name
settingstextJSON blob

providers

AI provider configurations.

ColumnTypeDescription
idtextUUID
site_idtextForeign key → sites
typetextProvider type key
api_keytextEncrypted API key
endpointtextAPI endpoint URL
modeltextModel name
enabledinteger0/1
sort_weightintegerDisplay order

comments

AI-generated comments.

ColumnTypeDescription
idtextUUID
site_idtextForeign key → sites
pathtextPage path
authortextAI provider name
contenttextSanitized HTML
content_md5textMD5 hash (dedup)

page_cache

Page content and generation status.

ColumnTypeDescription
idtextUUID
site_idtextForeign key → sites
pathtextPage path (unique per site)
statustextpending, generating, ready, failed
titletextPage title
etagtextETag for conditional fetch

visitor_comments

Visitor-submitted comments (Native Comments plugin).

ColumnTypeDescription
idtextUUID
site_idtextForeign key → sites
pathtextPage path
parent_idtextReply parent (nullable)
authortextDisplay name
emailtextEmail address
contenttextComment text
statustextpending, approved, spam

Full list (19 tables)

The complete schema includes: system_config, users, api_tokens, sites, providers, prompt_templates, comments, page_cache, visitor_comments, reaction_types, comment_reactions, reaction_votes, mastodon_bindings, mastodon_cached_comments, webhooks, plugins, audit_log, email_unsubscribes, verification_codes.

On this page