There is no migration framework in the current codebase — the schema is maintained as a single idempotent schema.sql. For production schema changes, apply DDL statements manually or through your database management tooling.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Agent Charley","colors":{"primary":"#FF5A50","light":"#FF8C6A","dark":"#FF3030"},"logo":{"light":"https://mintcdn.com/charlemagnelabs/39arrCphjmm7Dz5Y/logo/light.svg?fit=max\u0026auto=format\u0026n=39arrCphjmm7Dz5Y\u0026q=85\u0026s=0e11c5035eb5f3f263ed9fa34158fddc","dark":"https://mintcdn.com/charlemagnelabs/39arrCphjmm7Dz5Y/logo/dark.svg?fit=max\u0026auto=format\u0026n=39arrCphjmm7Dz5Y\u0026q=85\u0026s=dd89d9bc5a51e5807bef991d67e93fab"},"favicon":"https://mintcdn.com/charlemagnelabs/39arrCphjmm7Dz5Y/favicon.svg?fit=max\u0026auto=format\u0026n=39arrCphjmm7Dz5Y\u0026q=85\u0026s=e1a7557145bd4972f70af286f1c083a0","navbar":{"links":[{"href":"https://dash.charlemagnelabs.ai","label":"Dashboard"}],"primary":{"type":"button","label":"Get Started","href":"https://dash.charlemagnelabs.ai"}},"footer":{"socials":{"github":"https://github.com/Charlemagne-Labs"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"charlemagnelabs","hasAudioNarration":false,"actualSubdomain":"charlemagnelabs","customDomains":["docs.charlemagnelabs.ai"],"gitSource":{"type":"github","owner":"charlemagne-labs","repo":"agent-charley-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a46b2615c01ed6b564eae87","collectionId":"da685b4d-23a1-40f4-add3-252b440def40","schemaVersion":"v3"},"entitlements":{},"buildId":"6a46b2615c01ed6b564eae87:success","clientVersion":"0.0.3969","searchFilterCounts":[{"language":"default","tag":"API Reference","count":10},{"language":"default","tag":"Dashboard","count":9},{"language":"default","tag":"Policy as Code","count":8},{"language":"default","tag":"Self-Hosting","count":4},{"language":"default","tag":"Integrations","count":3},{"language":"default","tag":"Overview","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"self-hosting/database","slug":"/self-hosting/database","pageMetadata":{"title":"Database Setup","description":"Initialize and seed the Charley PostgreSQL database","href":"/self-hosting/database"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Initialize and seed the Charley PostgreSQL database\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Charley requires `,_jsx(_components.strong,{children:`PostgreSQL 16`}),`. The schema is fully idempotent — you can apply it multiple times safely.`]}),`\n`,_jsx(Heading,{level:`2`,id:`applying-the-schema`,children:`Applying the Schema`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`psql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $DATABASE_RW_URL`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` db/schema.sql`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The schema creates the following tables:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Table`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`orgs`})}),_jsx(_components.td,{children:`Organizations / workspaces`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`org_members`})}),_jsx(_components.td,{children:`Members with roles`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`licenses`})}),_jsx(_components.td,{children:`Billing plan and subscription state`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`devices`})}),_jsx(_components.td,{children:`Enrolled endpoint devices`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`telemetry_rollups`})}),_jsx(_components.td,{children:`Hourly and daily analytics aggregates`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`device_enrollment_codes`})}),_jsx(_components.td,{children:`One-time enrollment codes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`org_invites`})}),_jsx(_components.td,{children:`Pending email invitations`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`notifications`})}),_jsx(_components.td,{children:`In-app notification feed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`org_sso_config`})}),_jsx(_components.td,{children:`SAML/OIDC SSO configuration`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`org_alert_endpoints`})}),_jsx(_components.td,{children:`Webhook alert destinations`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`org_slack_integrations`})}),_jsx(_components.td,{children:`Slack workspace connections`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`seed-data-development`,children:`Seed Data (Development)`}),`\n`,_jsx(_components.p,{children:`To populate the database with a test organization and sample telemetry:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`psql`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $DATABASE_RW_URL`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` db/seed.sql`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The seed creates:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`1 test organization`}),`\n`,_jsxs(_components.li,{children:[`1 ORG_ADMIN member (matched by email — update `,_jsx(_components.code,{children:`seed.sql`}),` to match your Auth0 user’s email)`]}),`\n`,_jsx(_components.li,{children:`2 test devices`}),`\n`,_jsx(_components.li,{children:`30 days of daily telemetry rollups`}),`\n`,_jsx(_components.li,{children:`48 hours of hourly telemetry rollups`}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Only apply `,_jsx(_components.code,{children:`seed.sql`}),` to development databases. It inserts fixed IDs that will conflict if applied to a database that already has data.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`running-locally-with-docker`,children:`Running Locally with Docker`}),`\n`,_jsxs(_components.p,{children:[`The repository includes a `,_jsx(_components.code,{children:`docker-compose.yml`}),` for local development:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Start Postgres only`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`./dev.sh`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --local-db`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Start Postgres + pgAdmin GUI`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`./dev.sh`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --local-db`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --tools`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`pgAdmin is available at `,_jsx(_components.code,{children:`http://localhost:5050`}),` when started with `,_jsx(_components.code,{children:`--tools`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`connection-details-local-docker`,children:`Connection Details (local Docker)`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Host`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`localhost`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Port`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`5432`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Database`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`charley`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`User`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`charley`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Password`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`secret`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`migrations`,children:`Migrations`}),`\n`,_jsxs(_components.p,{children:[`There is no migration framework in the current codebase — the schema is maintained as a single idempotent `,_jsx(_components.code,{children:`schema.sql`}),`. For production schema changes, apply DDL statements manually or through your database management tooling.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Database Setup","description":"Initialize and seed the Charley PostgreSQL database","href":"/self-hosting/database"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Applying the Schema","slug":"applying-the-schema","depth":2,"children":[]},{"title":"Seed Data (Development)","slug":"seed-data-development","depth":2,"children":[]},{"title":"Running Locally with Docker","slug":"running-locally-with-docker","depth":2,"children":[{"title":"Connection Details (local Docker)","slug":"connection-details-local-docker","depth":3,"children":[]}]},{"title":"Migrations","slug":"migrations","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"charlemagnelabs","siteName":"Agent Charley","title":"Database Setup - Agent Charley","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-03-10T16:16:23.341Z","originalFileLocation":"self-hosting/database.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Initialize and seed the Charley PostgreSQL database\">\u003cmeta data-mint-head name=\"application-name\" content=\"Agent Charley\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Database Setup - Agent Charley\">\u003cmeta data-mint-head property=\"og:description\" content=\"Initialize and seed the Charley PostgreSQL database\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Agent Charley\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.charlemagnelabs.ai/self-hosting/database\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://charlemagnelabs.mintlify.app/_mintlify/api/og/v2?division=Self-Hosting\u0026amp;title=Database+Setup\u0026amp;description=Initialize+and+seed+the+Charley+PostgreSQL+database\u0026amp;theme=2c360077c0e896d0d4c566a8\u0026amp;signature=2ab30712b8a3aedc86eac726bdbaea2d058decff5f9cdc0ea50928a88e0dba3d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Database Setup - Agent Charley\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Initialize and seed the Charley PostgreSQL database\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://charlemagnelabs.mintlify.app/_mintlify/api/og/v2?division=Self-Hosting\u0026amp;title=Database+Setup\u0026amp;description=Initialize+and+seed+the+Charley+PostgreSQL+database\u0026amp;theme=2c360077c0e896d0d4c566a8\u0026amp;signature=2ab30712b8a3aedc86eac726bdbaea2d058decff5f9cdc0ea50928a88e0dba3d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/charlemagnelabs/j6sX1Az6NogZWzq_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Agent Charley\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF5A50\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.charlemagnelabs.ai/self-hosting/database\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/self-hosting/database.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.charlemagnelabs.ai/#organization\",\"name\":\"Agent Charley\",\"url\":\"https://docs.charlemagnelabs.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/charlemagnelabs/39arrCphjmm7Dz5Y/logo/light.svg?fit=max\u0026auto=format\u0026n=39arrCphjmm7Dz5Y\u0026q=85\u0026s=0e11c5035eb5f3f263ed9fa34158fddc\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.charlemagnelabs.ai#website\",\"name\":\"Agent Charley\",\"url\":\"https://docs.charlemagnelabs.ai\",\"publisher\":{\"@id\":\"https://docs.charlemagnelabs.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.charlemagnelabs.ai/self-hosting/database#webpage\",\"url\":\"https://docs.charlemagnelabs.ai/self-hosting/database\",\"name\":\"Database Setup\",\"description\":\"Initialize and seed the Charley PostgreSQL database\",\"dateModified\":\"2026-03-10T16:16:23.341Z\",\"isPartOf\":{\"@id\":\"https://docs.charlemagnelabs.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.charlemagnelabs.ai/self-hosting/database#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.charlemagnelabs.ai/self-hosting/database#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Self-Hosting\",\"item\":\"https://docs.charlemagnelabs.ai/self-hosting/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Database Setup\",\"item\":\"https://docs.charlemagnelabs.ai/self-hosting/database\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.charlemagnelabs.ai/self-hosting/database#article\",\"headline\":\"Database Setup\",\"name\":\"Database Setup\",\"description\":\"Initialize and seed the Charley PostgreSQL database\",\"url\":\"https://docs.charlemagnelabs.ai/self-hosting/database\",\"mainEntityOfPage\":{\"@id\":\"https://docs.charlemagnelabs.ai/self-hosting/database#webpage\"},\"dateModified\":\"2026-03-10T16:16:23.341Z\",\"publisher\":{\"@id\":\"https://docs.charlemagnelabs.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.charlemagnelabs.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Agent Charley\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Agent Charley","nav":{"global":null,"groups":[{"group":"Overview","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"}]},{"group":"Dashboard","pages":[{"title":"Overview","href":"/dashboard/overview"},{"title":"Devices","href":"/dashboard/devices"},{"title":"Groups","href":"/dashboard/groups"},{"title":"Policies","href":"/dashboard/policies"},{"title":"Members","href":"/dashboard/members"},{"title":"Billing","href":"/dashboard/billing"},{"title":"Settings","href":"/dashboard/settings"},{"title":"Notifications","href":"/dashboard/notifications"},{"title":"Download Agent Charley","href":"/dashboard/download"}]},{"group":"Policy as Code","pages":[{"title":"Policy as Code Overview","sidebarTitle":"Overview","href":"/policy-as-code/overview"},{"title":"API Keys","sidebarTitle":"API Keys","href":"/policy-as-code/authentication"},{"title":"Getting Started","sidebarTitle":"Getting Started","href":"/policy-as-code/getting-started"},{"title":"Policy Reference","sidebarTitle":"Policy Reference","href":"/policy-as-code/policy-reference"},{"title":"Groups","sidebarTitle":"Groups","href":"/policy-as-code/groups"},{"title":"CLI Reference","sidebarTitle":"CLI Reference","href":"/policy-as-code/cli-reference"},{"title":"Example Policies","sidebarTitle":"Examples","href":"/policy-as-code/examples"},{"title":"End-to-End Testing Guide","sidebarTitle":"Testing Guide","href":"/policy-as-code/testing-guide"}]},{"group":"Integrations","pages":[{"title":"Slack","href":"/integrations/slack"},{"title":"SSO","href":"/integrations/sso"},{"title":"Webhooks","href":"/integrations/webhooks"}]},{"group":"API Reference","pages":[{"title":"API Overview","href":"/api-reference/overview"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Session","href":"/api-reference/session"},{"title":"Devices","href":"/api-reference/devices"},{"title":"Analytics","href":"/api-reference/analytics"},{"title":"Members \u0026 Invites","href":"/api-reference/members"},{"title":"Billing","href":"/api-reference/billing"},{"title":"Enrollment","href":"/api-reference/enrollment"},{"title":"Notifications","href":"/api-reference/notifications"},{"title":"Alert Endpoints","href":"/api-reference/alerts"}]},{"group":"Self-Hosting","pages":[{"title":"Self-Hosting Overview","href":"/self-hosting/overview"},{"title":"Environment Variables","description":"Configuration reference for the Charley API and dashboard","href":"/self-hosting/environment-variables"},{"title":"Database Setup","href":"/self-hosting/database"},{"title":"Deployment","description":"Deploy the Charley API (Docker/ECS) and dashboard (S3/CDN)","href":"/self-hosting/deployment"}]}]},"title":"Database Setup - Agent Charley","buildId":"dpl_G8u2B2Ji9qJYF9umedjv293TxycS","deploymentId":"dpl_G8u2B2Ji9qJYF9umedjv293TxycS","dynamics":[],"chunks":[]}