[{"data":1,"prerenderedAt":1116},["ShallowReactive",2],{"navigation_docs":3,"-docs-core-operations-upgrades-and-schema-changes":478,"-docs-core-operations-upgrades-and-schema-changes-surround":1111},[4,352,446],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Docs",false,"\u002Fdocs\u002Fcore","docs\u002F1.core",[10,35,141,174,195,212,242,318],{"title":11,"icon":6,"path":12,"stem":13,"children":14,"page":6},"Getting Started","\u002Fdocs\u002Fcore\u002Fgetting-started","docs\u002F1.core\u002F1.getting-started",[15,19,23,27,31],{"title":16,"path":17,"stem":18},"Introduction","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fintroduction","docs\u002F1.core\u002F1.getting-started\u002F1.introduction",{"title":20,"path":21,"stem":22},"Quick Start","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fquick-start","docs\u002F1.core\u002F1.getting-started\u002F2.quick-start",{"title":24,"path":25,"stem":26},"Add to an Existing Site","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fexisting-site","docs\u002F1.core\u002F1.getting-started\u002F3.existing-site",{"title":28,"path":29,"stem":30},"Configuration","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fconfiguration","docs\u002F1.core\u002F1.getting-started\u002F4.configuration",{"title":32,"path":33,"stem":34},"How Tenon works","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fhow-tenon-works","docs\u002F1.core\u002F1.getting-started\u002F5.how-tenon-works",{"title":36,"icon":6,"path":37,"stem":38,"children":39,"page":6},"Content Modeling","\u002Fdocs\u002Fcore\u002Fcontent-modeling","docs\u002F1.core\u002F2.content-modeling",[40,44,111,115,119],{"title":41,"path":42,"stem":43},"Collections and Globals","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fcollections-and-globals","docs\u002F1.core\u002F2.content-modeling\u002F1.collections-and-globals",{"title":45,"icon":6,"path":46,"stem":47,"children":48},"Fields","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002Findex",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Array","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Farray","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F01.array",{"title":56,"path":57,"stem":58},"Blocks","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fblocks","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F02.blocks",{"title":60,"path":61,"stem":62},"Boolean","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fboolean","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F03.boolean",{"title":64,"path":65,"stem":66},"Date","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fdate","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F04.date",{"title":68,"path":69,"stem":70},"File","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ffile","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F05.file",{"title":72,"path":73,"stem":74},"Group","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fgroup","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F06.group",{"title":76,"path":77,"stem":78},"Image","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fimage","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F07.image",{"title":80,"path":81,"stem":82},"Link","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Flink","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F08.link",{"title":84,"path":85,"stem":86},"Number","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fnumber","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F09.number",{"title":88,"path":89,"stem":90},"Relation","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frelation","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F10.relation",{"title":92,"path":93,"stem":94},"Rich text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frich-text","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F11.rich-text",{"title":96,"path":97,"stem":98},"Select","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fselect","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F12.select",{"title":100,"path":101,"stem":102},"Size","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fsize","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F13.size",{"title":104,"path":105,"stem":106},"Slug","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fslug","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F14.slug",{"title":108,"path":109,"stem":110},"Text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ftext","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F15.text",{"title":112,"path":113,"stem":114},"Relations","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Frelations","docs\u002F1.core\u002F2.content-modeling\u002F3.relations",{"title":116,"path":117,"stem":118},"Media","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fmedia","docs\u002F1.core\u002F2.content-modeling\u002F4.media",{"title":120,"icon":6,"path":121,"stem":122,"children":123},"Presets","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002Findex",[124,125,129,133,137],{"title":50,"path":121,"stem":122},{"title":126,"path":127,"stem":128},"Menu","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fmenu","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F1.menu",{"title":130,"path":131,"stem":132},"Pages","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fpages","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F2.pages",{"title":134,"path":135,"stem":136},"Settings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fsettings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F3.settings",{"title":138,"path":139,"stem":140},"Strings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fstrings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F4.strings",{"title":142,"icon":6,"path":143,"stem":144,"children":145,"page":6},"Working with Content","\u002Fdocs\u002Fcore\u002Fworking-with-content","docs\u002F1.core\u002F3.working-with-content",[146,150,154,158,162,166,170],{"title":147,"path":148,"stem":149},"Reading","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Freading","docs\u002F1.core\u002F3.working-with-content\u002F1.reading",{"title":151,"path":152,"stem":153},"Writing and Drafts","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fwriting","docs\u002F1.core\u002F3.working-with-content\u002F2.writing",{"title":155,"path":156,"stem":157},"Scheduled publishing","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fscheduled-publishing","docs\u002F1.core\u002F3.working-with-content\u002F3.scheduled-publishing",{"title":159,"path":160,"stem":161},"HTTP API and Client","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhttp-api-and-client","docs\u002F1.core\u002F3.working-with-content\u002F4.http-api-and-client",{"title":163,"path":164,"stem":165},"Headless","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fheadless","docs\u002F1.core\u002F3.working-with-content\u002F5.headless",{"title":167,"path":168,"stem":169},"Localization","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Flocalization","docs\u002F1.core\u002F3.working-with-content\u002F6.localization",{"title":171,"path":172,"stem":173},"Hooks","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhooks","docs\u002F1.core\u002F3.working-with-content\u002F7.hooks",{"title":175,"icon":6,"path":176,"stem":177,"children":178,"page":6},"Building Your Site","\u002Fdocs\u002Fcore\u002Fbuilding-your-site","docs\u002F1.core\u002F4.building-your-site",[179,183,187,191],{"title":180,"path":181,"stem":182},"Pages and SEO","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fpages-and-seo","docs\u002F1.core\u002F4.building-your-site\u002F1.pages-and-seo",{"title":184,"path":185,"stem":186},"Components","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fcomponents","docs\u002F1.core\u002F4.building-your-site\u002F2.components",{"title":188,"path":189,"stem":190},"Menus","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fmenus","docs\u002F1.core\u002F4.building-your-site\u002F3.menus",{"title":192,"path":193,"stem":194},"Live Preview","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Flive-preview","docs\u002F1.core\u002F4.building-your-site\u002F4.live-preview",{"title":196,"icon":6,"path":197,"stem":198,"children":199,"page":6},"Users and Access","\u002Fdocs\u002Fcore\u002Fusers-and-access","docs\u002F1.core\u002F5.users-and-access",[200,204,208],{"title":201,"path":202,"stem":203},"Authentication","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fauthentication","docs\u002F1.core\u002F5.users-and-access\u002F1.authentication",{"title":205,"path":206,"stem":207},"Access Control","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Faccess-control","docs\u002F1.core\u002F5.users-and-access\u002F2.access-control",{"title":209,"path":210,"stem":211},"API Keys","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fapi-keys","docs\u002F1.core\u002F5.users-and-access\u002F3.api-keys",{"title":213,"icon":6,"path":214,"stem":215,"children":216},"Customization","\u002Fdocs\u002Fcore\u002Fcustomization","docs\u002F1.core\u002F6.customization\u002Findex",[217,218,222,226,230,234,238],{"title":50,"path":214,"stem":215},{"title":219,"path":220,"stem":221},"Admin","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fadmin","docs\u002F1.core\u002F6.customization\u002F1.admin",{"title":223,"path":224,"stem":225},"Custom Fields","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-fields","docs\u002F1.core\u002F6.customization\u002F2.custom-fields",{"title":227,"path":228,"stem":229},"Custom Pages and Actions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-pages-and-actions","docs\u002F1.core\u002F6.customization\u002F3.custom-pages-and-actions",{"title":231,"path":232,"stem":233},"Styles and UI Libraries","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fstyles-and-ui-libraries","docs\u002F1.core\u002F6.customization\u002F4.styles-and-ui-libraries",{"title":235,"path":236,"stem":237},"Rich Text Extensions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Frich-text-extensions","docs\u002F1.core\u002F6.customization\u002F5.rich-text-extensions",{"title":239,"path":240,"stem":241},"Plugins","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fplugins","docs\u002F1.core\u002F6.customization\u002F6.plugins",{"title":243,"icon":6,"path":244,"stem":245,"children":246},"Operations","\u002Fdocs\u002Fcore\u002Foperations","docs\u002F1.core\u002F7.operations\u002Findex",[247,248,266,288,306,310,314],{"title":50,"path":244,"stem":245},{"title":249,"icon":6,"path":250,"stem":251,"children":252},"Email","\u002Fdocs\u002Fcore\u002Foperations\u002Femail","docs\u002F1.core\u002F7.operations\u002F1.email\u002Findex",[253,254,258,262],{"title":50,"path":250,"stem":251},{"title":255,"path":256,"stem":257},"SMTP","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fsmtp","docs\u002F1.core\u002F7.operations\u002F1.email\u002F1.smtp",{"title":259,"path":260,"stem":261},"Cloudflare","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcloudflare","docs\u002F1.core\u002F7.operations\u002F1.email\u002F2.cloudflare",{"title":263,"path":264,"stem":265},"Custom adapter","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcustom-adapter","docs\u002F1.core\u002F7.operations\u002F1.email\u002F3.custom-adapter",{"title":267,"icon":6,"path":268,"stem":269,"children":270},"Jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002Findex",[271,272,276,280,284],{"title":50,"path":268,"stem":269},{"title":273,"path":274,"stem":275},"Queue jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fqueue-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F1.queue-jobs",{"title":277,"path":278,"stem":279},"Recurring jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Frecurring-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F2.recurring-jobs",{"title":281,"path":282,"stem":283},"The clock","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fclock","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F3.clock",{"title":285,"path":286,"stem":287},"Manage jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fmanage-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F4.manage-jobs",{"title":289,"icon":6,"path":290,"stem":291,"children":292},"Webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002Findex",[293,294,298,302],{"title":50,"path":290,"stem":291},{"title":295,"path":296,"stem":297},"Send webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Fsend-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F1.send-webhooks",{"title":299,"path":300,"stem":301},"Receive webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Freceive-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F2.receive-webhooks",{"title":303,"path":304,"stem":305},"Rebuild on publish","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Frebuild-on-publish","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F3.rebuild-on-publish",{"title":307,"path":308,"stem":309},"Backup and Restore","\u002Fdocs\u002Fcore\u002Foperations\u002Fbackup-and-restore","docs\u002F1.core\u002F7.operations\u002F4.backup-and-restore",{"title":311,"path":312,"stem":313},"Lifecycle Hooks","\u002Fdocs\u002Fcore\u002Foperations\u002Flifecycle-hooks","docs\u002F1.core\u002F7.operations\u002F5.lifecycle-hooks",{"title":315,"path":316,"stem":317},"Upgrades and Schema Changes","\u002Fdocs\u002Fcore\u002Foperations\u002Fupgrades-and-schema-changes","docs\u002F1.core\u002F7.operations\u002F6.upgrades-and-schema-changes",{"title":319,"icon":6,"path":320,"stem":321,"children":322,"page":6},"Reference","\u002Fdocs\u002Fcore\u002Freference","docs\u002F1.core\u002F8.reference",[323,326,344,348],{"title":28,"path":324,"stem":325},"\u002Fdocs\u002Fcore\u002Freference\u002Fconfiguration","docs\u002F1.core\u002F8.reference\u002F1.configuration",{"title":327,"icon":6,"path":328,"stem":329,"children":330},"API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi","docs\u002F1.core\u002F8.reference\u002F2.api\u002Findex",[331,332,336,340],{"title":50,"path":328,"stem":329},{"title":333,"path":334,"stem":335},"Local API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Flocal-api","docs\u002F1.core\u002F8.reference\u002F2.api\u002F1.local-api",{"title":337,"path":338,"stem":339},"Client","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fclient","docs\u002F1.core\u002F8.reference\u002F2.api\u002F2.client",{"title":341,"path":342,"stem":343},"HTTP routes","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fhttp-routes","docs\u002F1.core\u002F8.reference\u002F2.api\u002F3.http-routes",{"title":345,"path":346,"stem":347},"Errors and types","\u002Fdocs\u002Fcore\u002Freference\u002Ferrors-and-types","docs\u002F1.core\u002F8.reference\u002F3.errors-and-types",{"title":349,"path":350,"stem":351},"Package exports","\u002Fdocs\u002Fcore\u002Freference\u002Fpackage-exports","docs\u002F1.core\u002F8.reference\u002F4.package-exports",{"title":353,"icon":6,"path":354,"stem":355,"children":356,"page":6},"Guide","\u002Fdocs\u002Fguide","docs\u002F2.guide",[357,383,400,417],{"title":358,"icon":6,"path":359,"stem":360,"children":361},"Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks","docs\u002F2.guide\u002F1.frameworks\u002Findex",[362,363,367,371,375,379],{"title":50,"path":359,"stem":360},{"title":364,"path":365,"stem":366},"Astro","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fastro","docs\u002F2.guide\u002F1.frameworks\u002F1.astro",{"title":368,"path":369,"stem":370},"Nuxt","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fnuxt","docs\u002F2.guide\u002F1.frameworks\u002F2.nuxt",{"title":372,"path":373,"stem":374},"TanStack Start","\u002Fdocs\u002Fguide\u002Fframeworks\u002Ftanstack-start","docs\u002F2.guide\u002F1.frameworks\u002F3.tanstack-start",{"title":376,"path":377,"stem":378},"Standalone","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fstandalone","docs\u002F2.guide\u002F1.frameworks\u002F4.standalone",{"title":380,"path":381,"stem":382},"Other Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fother-frameworks","docs\u002F2.guide\u002F1.frameworks\u002F5.other-frameworks",{"title":384,"icon":6,"path":385,"stem":386,"children":387},"Deployment","\u002Fdocs\u002Fguide\u002Fdeployment","docs\u002F2.guide\u002F2.deployment\u002Findex",[388,389,393,397],{"title":50,"path":385,"stem":386},{"title":390,"path":391,"stem":392},"Node","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fnode","docs\u002F2.guide\u002F2.deployment\u002F1.node",{"title":394,"path":395,"stem":396},"Vercel","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fvercel","docs\u002F2.guide\u002F2.deployment\u002F2.vercel",{"title":259,"path":398,"stem":399},"\u002Fdocs\u002Fguide\u002Fdeployment\u002Fcloudflare","docs\u002F2.guide\u002F2.deployment\u002F3.cloudflare",{"title":401,"icon":6,"path":402,"stem":403,"children":404,"page":6},"Databases and Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage","docs\u002F2.guide\u002F3.databases-and-storage",[405,409,413],{"title":406,"path":407,"stem":408},"Databases","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fdatabases","docs\u002F2.guide\u002F3.databases-and-storage\u002F1.databases",{"title":410,"path":411,"stem":412},"Media Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fmedia-storage","docs\u002F2.guide\u002F3.databases-and-storage\u002F2.media-storage",{"title":414,"path":415,"stem":416},"Image Providers","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fimage-providers","docs\u002F2.guide\u002F3.databases-and-storage\u002F3.image-providers",{"title":418,"icon":6,"path":419,"stem":420,"children":421,"page":6},"Recipes","\u002Fdocs\u002Fguide\u002Frecipes","docs\u002F2.guide\u002F4.recipes",[422,426,430,434,438,442],{"title":423,"path":424,"stem":425},"Seed Content","\u002Fdocs\u002Fguide\u002Frecipes\u002Fseed-content","docs\u002F2.guide\u002F4.recipes\u002F1.seed-content",{"title":427,"path":428,"stem":429},"Tracking and Consent","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftracking-and-consent","docs\u002F2.guide\u002F4.recipes\u002F2.tracking-and-consent",{"title":431,"path":432,"stem":433},"Build a Custom Field","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-custom-field","docs\u002F2.guide\u002F4.recipes\u002F3.build-a-custom-field",{"title":435,"path":436,"stem":437},"Write a Plugin","\u002Fdocs\u002Fguide\u002Frecipes\u002Fwrite-a-plugin","docs\u002F2.guide\u002F4.recipes\u002F4.write-a-plugin",{"title":439,"path":440,"stem":441},"Build a Headless Site with Next.js","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-headless-site-with-nextjs","docs\u002F2.guide\u002F4.recipes\u002F5.build-a-headless-site-with-nextjs",{"title":443,"path":444,"stem":445},"Troubleshooting","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftroubleshooting","docs\u002F2.guide\u002F4.recipes\u002F6.troubleshooting",{"title":447,"icon":6,"path":448,"stem":449,"children":450,"page":6},"CLI","\u002Fdocs\u002Fcli","docs\u002F3.cli",[451,454,458,462,466,470,474],{"title":50,"path":452,"stem":453},"\u002Fdocs\u002Fcli\u002Foverview","docs\u002F3.cli\u002F1.overview",{"title":455,"path":456,"stem":457},"create-tenoncms","\u002Fdocs\u002Fcli\u002Fcreate-tenoncms","docs\u002F3.cli\u002F2.create-tenoncms",{"title":459,"path":460,"stem":461},"tenon backup","\u002Fdocs\u002Fcli\u002Fbackup","docs\u002F3.cli\u002F3.backup",{"title":463,"path":464,"stem":465},"tenon users","\u002Fdocs\u002Fcli\u002Fusers","docs\u002F3.cli\u002F4.users",{"title":467,"path":468,"stem":469},"tenon media","\u002Fdocs\u002Fcli\u002Fmedia","docs\u002F3.cli\u002F5.media",{"title":471,"path":472,"stem":473},"tenon upgrade","\u002Fdocs\u002Fcli\u002Fupgrade","docs\u002F3.cli\u002F6.upgrade",{"title":475,"path":476,"stem":477},"tenon login","\u002Fdocs\u002Fcli\u002Flogin","docs\u002F3.cli\u002F7.login",{"id":479,"title":315,"body":480,"description":1105,"extension":1106,"links":1107,"meta":1108,"navigation":727,"path":316,"seo":1109,"stem":317,"__hash__":1110},"docs\u002Fdocs\u002F1.core\u002F7.operations\u002F6.upgrades-and-schema-changes.md",{"type":481,"value":482,"toc":1093},"minimark",[483,487,492,500,530,545,548,552,555,667,671,674,898,924,928,931,938,941,950,972,977,981,986,1016,1020,1024,1033,1036,1053,1056,1060,1089],[484,485,486],"p",{},"A deploy can change two things: your schema, like a new or renamed field, and the version of Tenon. Neither needs a command. Tenon updates its own tables when it starts, and stored content stays as it is until an editor saves it. This page explains what happens to existing content after each kind of change, and how to upgrade safely.",[488,489,491],"h2",{"id":490},"how-tenon-updates-the-database","How Tenon updates the database",[484,493,494,495,499],{},"Tenon keeps its tables up to date with migrations. They are code inside ",[496,497,498],"code",{},"tenoncms",", and they run on the first database query of a process:",[501,502,503,507,516],"ol",{},[504,505,506],"li",{},"The migrations of Tenon, then those of better-auth and its plugins.",[504,508,509,510,515],{},"A check of the ",[511,512,514],"a",{"href":513},"#localized-fields","localized fields",".",[504,517,518,521,522,525,526,515],{},[496,519,520],{},"seed"," and ",[496,523,524],{},"onInit",". See ",[511,527,529],{"href":528},"\u002Fdocs\u002Fcore\u002Foperations\u002Flifecycle-hooks#when-they-run","Lifecycle hooks",[531,532,533,536,539],"ul",{},[504,534,535],{},"On Postgres, PGlite and libSQL, all migrations run in one transaction. If one fails, nothing changes, and the next query tries again.",[504,537,538],{},"Serverless hosts start many instances at once. On Postgres and libSQL, they wait for each other, so only one migrates.",[504,540,541,544],{},[496,542,543],{},"node:sqlite"," and Durable Objects have no lock between processes. Run one process per database.",[484,546,547],{},"Your own fields need no migration. All documents live in one table as JSON, so a new field is just a new key.",[488,549,551],{"id":550},"change-your-schema","Change your schema",[484,553,554],{},"Tenon does not rewrite stored documents when you change a field. Each document keeps what it has until its next save, and the save applies the new schema:",[556,557,558,571],"table",{},[559,560,561],"thead",{},[562,563,564,568],"tr",{},[565,566,567],"th",{},"Change",[565,569,570],{},"Existing documents",[572,573,574,587,599,607,615,623,638,652],"tbody",{},[562,575,576,580],{},[577,578,579],"td",{},"Add a field",[577,581,582,583,586],{},"Have no value. ",[496,584,585],{},"default"," applies only to new documents.",[562,588,589,596],{},[577,590,591,592,595],{},"Add a ",[496,593,594],{},"required"," field",[577,597,598],{},"Have no value. The next publish asks for it.",[562,600,601,604],{},[577,602,603],{},"Remove a field",[577,605,606],{},"Keep the value in the database, but reads leave it out. The next save drops it.",[562,608,609,612],{},[577,610,611],{},"Rename a field",[577,613,614],{},"The same as removing the old field and adding a new one. The values do not move.",[562,616,617,620],{},[577,618,619],{},"Change the type of a field",[577,621,622],{},"Keep the old value. Reads return it as stored, and the next save fails until an editor fixes it.",[562,624,625,635],{},[577,626,627,628,631,632],{},"Add a rule like ",[496,629,630],{},"unique"," or ",[496,633,634],{},"maxLength",[577,636,637],{},"Keep their values. The rule applies on the next save.",[562,639,640,646],{},[577,641,642,643],{},"Change ",[496,644,645],{},"localized",[577,647,648,649,515],{},"The values move at start. See ",[511,650,651],{"href":513},"Localized fields",[562,653,654,659],{},[577,655,642,656],{},[496,657,658],{},"media.images",[577,660,661,662,515],{},"Keep their old variants. Run ",[511,663,664],{"href":468},[496,665,666],{},"tenon media regenerate",[668,669,611],"h3",{"id":670},"rename-a-field",[484,672,673],{},"A rename loses the values of the old field. To keep them, rename in two deploys:",[501,675,676,679,895],{},[504,677,678],{},"Add the new field and keep the old one. Deploy.",[504,680,681,682],{},"Copy the values with a script:",[683,684,690],"pre",{"className":685,"code":686,"filename":687,"language":688,"meta":689,"style":689},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import cms from \"..\u002Ftenon.config\";\n\nconst posts = await cms.find(\"posts\");\nfor (const post of posts) {\n  if (post.summary && !post.excerpt) {\n    await cms.update(\"posts\", post.id, { excerpt: post.summary });\n  }\n}\n","scripts\u002Frename-summary.ts","ts","",[496,691,692,722,729,769,792,827,883,889],{"__ignoreMap":689},[693,694,697,701,705,708,712,716,719],"span",{"class":695,"line":696},"line",1,[693,698,700],{"class":699},"s7zQu","import",[693,702,704],{"class":703},"sTEyZ"," cms ",[693,706,707],{"class":699},"from",[693,709,711],{"class":710},"sMK4o"," \"",[693,713,715],{"class":714},"sfazB","..\u002Ftenon.config",[693,717,718],{"class":710},"\"",[693,720,721],{"class":710},";\n",[693,723,725],{"class":695,"line":724},2,[693,726,728],{"emptyLinePlaceholder":727},true,"\n",[693,730,732,736,739,742,745,748,750,754,757,759,762,764,767],{"class":695,"line":731},3,[693,733,735],{"class":734},"spNyl","const",[693,737,738],{"class":703}," posts ",[693,740,741],{"class":710},"=",[693,743,744],{"class":699}," await",[693,746,747],{"class":703}," cms",[693,749,515],{"class":710},[693,751,753],{"class":752},"s2Zo4","find",[693,755,756],{"class":703},"(",[693,758,718],{"class":710},[693,760,761],{"class":714},"posts",[693,763,718],{"class":710},[693,765,766],{"class":703},")",[693,768,721],{"class":710},[693,770,772,775,778,780,783,786,789],{"class":695,"line":771},4,[693,773,774],{"class":699},"for",[693,776,777],{"class":703}," (",[693,779,735],{"class":734},[693,781,782],{"class":703}," post ",[693,784,785],{"class":710},"of",[693,787,788],{"class":703}," posts) ",[693,790,791],{"class":710},"{\n",[693,793,795,798,801,804,806,809,812,815,817,819,822,825],{"class":695,"line":794},5,[693,796,797],{"class":699},"  if",[693,799,777],{"class":800},"swJcz",[693,802,803],{"class":703},"post",[693,805,515],{"class":710},[693,807,808],{"class":703},"summary",[693,810,811],{"class":710}," &&",[693,813,814],{"class":710}," !",[693,816,803],{"class":703},[693,818,515],{"class":710},[693,820,821],{"class":703},"excerpt",[693,823,824],{"class":800},") ",[693,826,791],{"class":710},[693,828,830,833,835,837,840,842,844,846,848,851,854,856,859,861,864,867,870,872,874,876,879,881],{"class":695,"line":829},6,[693,831,832],{"class":699},"    await",[693,834,747],{"class":703},[693,836,515],{"class":710},[693,838,839],{"class":752},"update",[693,841,756],{"class":800},[693,843,718],{"class":710},[693,845,761],{"class":714},[693,847,718],{"class":710},[693,849,850],{"class":710},",",[693,852,853],{"class":703}," post",[693,855,515],{"class":710},[693,857,858],{"class":703},"id",[693,860,850],{"class":710},[693,862,863],{"class":710}," {",[693,865,866],{"class":800}," excerpt",[693,868,869],{"class":710},":",[693,871,853],{"class":703},[693,873,515],{"class":710},[693,875,808],{"class":703},[693,877,878],{"class":710}," }",[693,880,766],{"class":800},[693,882,721],{"class":710},[693,884,886],{"class":695,"line":885},7,[693,887,888],{"class":710},"  }\n",[693,890,892],{"class":695,"line":891},8,[693,893,894],{"class":710},"}\n",[504,896,897],{},"Remove the old field. Deploy.",[531,899,900,907,921],{},[504,901,902,903,906],{},"Each ",[496,904,905],{},"cms.update()"," publishes, and runs the hooks and the validation like a save in the admin.",[504,908,909,910,913,914,917,918,515],{},"The imported ",[496,911,912],{},"cms"," reads published content. To copy drafts too, read with ",[496,915,916],{},"cms.withDrafts()"," and save with ",[496,919,920],{},"{ draft: true }",[504,922,923],{},"Test the script on a copy first: restore a backup into your local project.",[668,925,927],{"id":926},"remove-a-collection-or-a-global","Remove a collection or a global",[484,929,930],{},"Its documents stay in the database. Reads cannot reach them any more, but a backup still holds them. A restore of that backup into your config then stops, because the archive names a collection your config does not have.",[484,932,933,934,937],{},"To remove a collection cleanly, delete its documents first, in the admin or with ",[496,935,936],{},"cms.delete()",". Then remove it from the config.",[668,939,651],{"id":940},"localized-fields",[484,942,943,944,946,947,515],{},"When you turn ",[496,945,645],{}," on or off for a field, Tenon moves the stored values on the next start: from the shared data to the row of the default locale, or back. It logs each move, for example ",[496,948,949],{},"moved posts.title to locale rows (12 documents)",[531,951,952,958,965],{},[504,953,954,955,957],{},"The other locales keep their rows. Reads ignore them while the field is shared, so turning ",[496,956,645],{}," on again brings them back.",[504,959,960,961,964],{},"A new ",[496,962,963],{},"defaultLocale"," moves nothing. Tenon logs a warning with the number of documents that have no row in it.",[504,966,967,968,971],{},"A locale you remove from ",[496,969,970],{},"locales"," keeps its rows. Reads ignore them.",[484,973,974,975,515],{},"See ",[511,976,167],{"href":168},[488,978,980],{"id":979},"upgrade-tenon","Upgrade Tenon",[484,982,983,985],{},[496,984,471],{}," installs the latest version. Below 1.0, a new minor version MAY break your project:",[501,987,988,998,1004,1010,1013],{},[504,989,990,991,997],{},"Read the ",[511,992,996],{"href":993,"rel":994},"https:\u002F\u002Fgithub.com\u002FSuddenDev\u002FTenonCMS\u002Freleases",[995],"nofollow","release notes"," of every version in between.",[504,999,1000,1001,515],{},"Back up with ",[496,1002,1003],{},"npx tenon backup",[504,1005,1006,1007,515],{},"Run ",[496,1008,1009],{},"npx tenon upgrade",[504,1011,1012],{},"Start the project locally. The new migrations run on the first request.",[504,1014,1015],{},"Deploy. Production runs the same migrations on its first request.",[484,1017,974,1018,515],{},[511,1019,471],{"href":472},[668,1021,1023],{"id":1022},"roll-back","Roll back",[484,1025,1026,1027,1029,1030,515],{},"Migrations only go forward. An older version of ",[496,1028,498],{}," refuses to start on a database that a newer version migrated, with an error like ",[496,1031,1032],{},"corrupted migrations: previously executed migration … is missing",[484,1034,1035],{},"To go back:",[501,1037,1038,1044,1047],{},[504,1039,1040,1041,1043],{},"Install the old version of ",[496,1042,498],{}," again.",[504,1045,1046],{},"Point it to a new, empty database.",[504,1048,1049,1050,515],{},"Restore the backup you made before the upgrade with ",[496,1051,1052],{},"tenon restore",[484,1054,1055],{},"A full backup restores only into the same version that wrote it, so it fits the old version. Content written since the backup is lost, so roll back soon, or test the upgrade locally first.",[488,1057,1059],{"id":1058},"related-resources","Related resources",[531,1061,1062,1067,1073,1084],{},[504,1063,1064,1066],{},[511,1065,471],{"href":472},": the command, step by step.",[504,1068,1069,1072],{},[511,1070,1071],{"href":308},"Backup and restore",": back up before a change.",[504,1074,1075,1077,1078,1080,1081,1083],{},[511,1076,45],{"href":46},": ",[496,1079,585],{},", ",[496,1082,594],{}," and the other field options.",[504,1085,1086,1088],{},[511,1087,167],{"href":168},": locales and localized fields.",[1090,1091,1092],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":689,"searchDepth":724,"depth":724,"links":1094},[1095,1096,1101,1104],{"id":490,"depth":724,"text":491},{"id":550,"depth":724,"text":551,"children":1097},[1098,1099,1100],{"id":670,"depth":731,"text":611},{"id":926,"depth":731,"text":927},{"id":940,"depth":731,"text":651},{"id":979,"depth":724,"text":980,"children":1102},[1103],{"id":1022,"depth":731,"text":1023},{"id":1058,"depth":724,"text":1059},"What a deploy changes in the database, and how to change fields without losing content.","md",null,{},{"title":315,"description":1105},"9sinOzBs14F2XXKmcueouyO1lCS70oOhwDvnA49djLo",[1112,1114],{"title":311,"path":312,"stem":313,"description":1113,"children":-1},"Code that runs when the CMS starts, after an import and on unexpected errors.",{"title":28,"path":324,"stem":325,"description":1115,"children":-1},"Every option of defineCms(), with its type, its default and the page that explains it.",1795884689264]