1"use strict";(self.webpackChunkvircadia_public_website=self.webpackChunkvircadia_public_website||[]).push([[827],{7388:(e,i,t)=>{t.r(i),t.d(i,{assets:()=>o,contentTitle:()=>d,default:()=>u,frontMatter:()=>c,metadata:()=>s,toc:()=>p});const s=JSON.parse('{"id":"cli/database/reset/README","title":"Reset (Wipe)","description":"This SQL script provides functionality to reset the Vircadia World database by dropping schemas, roles, and publications.","source":"@site/docs/vircadia-world/cli/database/reset/README.mdx","sourceDirName":"cli/database/reset","slug":"/cli/database/reset/","permalink":"/vircadia-world/cli/database/reset/","draft":false,"unlisted":false,"editUrl":"https://github.com/Vircadia/vircadia-world/edit/master/cli/database/reset/README.mdx","tags":[],"version":"current","frontMatter":{"sidebar_label":"Reset (Wipe)"},"sidebar":"tutorialSidebar","previous":{"title":"Structure (Migration)","permalink":"/vircadia-world/cli/database/migration/"},"next":{"title":"Seed","permalink":"/vircadia-world/cli/database/seed/"}}');var r=t(4848),a=t(8453),n=t(8069);const l="DO $$ \nDECLARE\n pubname RECORD;\nBEGIN\n IF EXISTS (SELECT FROM pg_roles WHERE rolname = 'vircadia_agent_proxy') THEN\n DROP OWNED BY vircadia_agent_proxy;\n\n DROP ROLE vircadia_agent_proxy;\n END IF;\n\n -- Drop publications if they exist\n FOR pubname IN (SELECT p.pubname AS publication_name FROM pg_publication p)\n LOOP\n EXECUTE 'DROP PUBLICATION ' || quote_ident(pubname.publication_name);\n END LOOP;\n\n -- Drop specific schemas and all their contents\n DROP SCHEMA IF EXISTS public CASCADE;\n DROP SCHEMA IF EXISTS auth CASCADE;\n DROP SCHEMA IF EXISTS entity CASCADE;\n DROP SCHEMA IF EXISTS tick CASCADE;\n DROP SCHEMA IF EXISTS config CASCADE;\n -- Recreate the public schema (this is required for PostgreSQL)\n CREATE SCHEMA public;\n GRANT ALL ON SCHEMA public TO PUBLIC;\nEND $$;",c={sidebar_label:"Reset (Wipe)"},d="Reset (Wipe)",o={},p=[{value:"Environment Variables",id:"environment-variables",level:2},{value:"Reset Script",id:"reset-script",level:2}];function E(e){const i={code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.header,{children:(0,r.jsx)(i.h1,{id:"reset-wipe",children:"Reset (Wipe)"})}),"\n",(0,r.jsx)(i.p,{children:"This SQL script provides functionality to reset the Vircadia World database by dropping schemas, roles, and publications."}),"\n",(0,r.jsx)(i.h2,{id:"environment-variables",children:"Environment Variables"}),"\n",(0,r.jsx)(i.p,{children:"You can customize the reset process by setting these environment variables:"}),"\n",(0,r.jsxs)(i.ul,{children:["\n",(0,r.jsxs)(i.li,{children:[(0,r.jsx)("code",{children:"VRCA_CLI_SERVICE_POSTGRES_SYSTEM_RESET_DIR"}),": Overrides the default system reset files (as seen below) with a custom set of files"]}),"\n",(0,r.jsxs)(i.li,{children:[(0,r.jsx)("code",{children:"VRCA_CLI_SERVICE_POSTGRES_USER_RESET_DIR"}),": Optional: sets another directory for user-defined reset SQL scripts"]}),"\n"]}),"\n",(0,r.jsxs)(i.p,{children:["The reset process will execute all ",(0,r.jsx)(i.code,{children:".sql"})," files from both directories in alphanumeric order."]}),"\n",(0,r.jsx)(i.h2,{id:"reset-script",children:"Reset Script"}),"\n",(0,r.jsx)(n.A,{language:"sql",title:"reset.sql",children:l})]})}function u(e={}){const{wrapper:i}={...(0,a.R)(),...e.components};return i?(0,r.jsx)(i,{...e,children:(0,r.jsx)(E,{...e})}):E(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.