tinyzoo 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +10 -0
- package/README.md +46 -2
- package/app/app.config.ts +35 -0
- package/app/assets/brand/characters/bright/bird.svg +1 -0
- package/app/assets/brand/characters/bright/bunny.svg +1 -0
- package/app/assets/brand/characters/bright/elephant.svg +1 -0
- package/app/assets/brand/characters/bright/fox.svg +1 -0
- package/app/assets/brand/characters/bright/frog.svg +1 -0
- package/app/assets/brand/characters/bright/octopus.svg +1 -0
- package/app/assets/brand/characters/muted/bee.svg +1 -0
- package/app/assets/brand/characters/muted/bird.svg +1 -0
- package/app/assets/brand/characters/muted/butterfly.svg +1 -0
- package/app/assets/brand/characters/muted/chick.svg +1 -0
- package/app/assets/brand/characters/muted/cow.svg +1 -0
- package/app/assets/brand/characters/muted/deer.svg +1 -0
- package/app/assets/brand/characters/muted/duck.svg +1 -0
- package/app/assets/brand/characters/muted/elephant.svg +1 -0
- package/app/assets/brand/characters/muted/fox.svg +1 -0
- package/app/assets/brand/characters/muted/hedgehog.svg +1 -0
- package/app/assets/brand/characters/muted/koala.svg +1 -0
- package/app/assets/brand/characters/muted/ladybug.svg +1 -0
- package/app/assets/brand/characters/muted/lion.svg +1 -0
- package/app/assets/brand/characters/muted/mouse.svg +1 -0
- package/app/assets/brand/characters/muted/octopus.svg +1 -0
- package/app/assets/brand/characters/muted/owl.svg +1 -0
- package/app/assets/brand/characters/muted/panda.svg +1 -0
- package/app/assets/brand/characters/muted/penguin.svg +1 -0
- package/app/assets/brand/characters/muted/pig.svg +1 -0
- package/app/assets/brand/characters/muted/poodle.svg +1 -0
- package/app/assets/brand/characters/muted/raccoon.svg +1 -0
- package/app/assets/brand/characters/muted/seal.svg +1 -0
- package/app/assets/brand/characters/muted/sheep.svg +1 -0
- package/app/assets/brand/characters/muted/snail.svg +1 -0
- package/app/assets/brand/characters/muted/turtle.svg +1 -0
- package/app/assets/brand/characters/muted/whale.svg +1 -0
- package/app/assets/brand/logo/favicon.svg +1 -0
- package/app/assets/brand/logo/logo-primary-reversed.svg +1 -0
- package/app/assets/brand/logo/logo-primary.svg +1 -0
- package/app/assets/brand/logo/mascot-reversed.svg +1 -0
- package/app/assets/brand/logo/mascot.svg +1 -0
- package/app/assets/brand/logo/wordmark-reversed.svg +1 -0
- package/app/assets/brand/logo/wordmark.svg +1 -0
- package/app/assets/css/cms-admin.css +607 -0
- package/app/components/CmsBlocks.vue +30 -0
- package/app/components/CmsCell.vue +16 -0
- package/app/components/CmsCellBadge.vue +18 -0
- package/app/components/CmsCellBlocks.vue +9 -0
- package/app/components/CmsCellBoolean.vue +12 -0
- package/app/components/CmsCellCode.vue +7 -0
- package/app/components/CmsCellColor.vue +13 -0
- package/app/components/CmsCellDate.vue +10 -0
- package/app/components/CmsCellExcerpt.vue +21 -0
- package/app/components/CmsCellGallery.vue +10 -0
- package/app/components/CmsCellGroup.vue +23 -0
- package/app/components/CmsCellNumber.vue +7 -0
- package/app/components/CmsCellRelation.vue +8 -0
- package/app/components/CmsCellText.vue +12 -0
- package/app/components/CmsCellThumb.vue +18 -0
- package/app/components/CmsConfirmDialog.vue +55 -0
- package/app/components/CmsContent.vue +103 -0
- package/app/components/CmsDayPicker.vue +44 -0
- package/app/components/CmsEmptyState.vue +35 -0
- package/app/components/CmsField.vue +111 -0
- package/app/components/CmsFieldBlocks.vue +353 -0
- package/app/components/CmsFieldBoolean.vue +8 -0
- package/app/components/CmsFieldColor.vue +42 -0
- package/app/components/CmsFieldDate.vue +131 -0
- package/app/components/CmsFieldGallery.vue +114 -0
- package/app/components/CmsFieldGroup.vue +53 -0
- package/app/components/CmsFieldMedia.vue +219 -0
- package/app/components/CmsFieldNumber.vue +11 -0
- package/app/components/CmsFieldRelationMany.vue +54 -0
- package/app/components/CmsFieldRelationOne.vue +47 -0
- package/app/components/CmsFieldRichText.vue +45 -0
- package/app/components/CmsFieldSelect.vue +41 -0
- package/app/components/CmsFieldSlug.vue +46 -0
- package/app/components/CmsFieldText.vue +75 -0
- package/app/components/CmsFormSections.vue +150 -0
- package/app/components/CmsHighlight.vue +22 -0
- package/app/components/CmsImage.vue +39 -0
- package/app/components/CmsLinkPicker.vue +122 -0
- package/app/components/CmsLinkTarget.vue +35 -0
- package/app/components/CmsListFilters.vue +107 -0
- package/app/components/CmsLiveNotice.vue +64 -0
- package/app/components/CmsLoadError.vue +24 -0
- package/app/components/CmsMascot.vue +10 -0
- package/app/components/CmsMediaLibrary.vue +114 -0
- package/app/components/CmsMediaPreview.vue +34 -0
- package/app/components/CmsMediaThumb.vue +22 -0
- package/app/components/CmsMoment.vue +42 -0
- package/app/components/CmsNav.vue +39 -0
- package/app/components/CmsPage.vue +86 -0
- package/app/components/CmsPasswordInput.vue +22 -0
- package/app/components/CmsPresence.vue +29 -0
- package/app/components/CmsPreviewPanel.vue +131 -0
- package/app/components/CmsPublishReview.vue +102 -0
- package/app/components/CmsRevisions.vue +195 -0
- package/app/components/CmsRichTextEditor.vue +290 -0
- package/app/components/CmsSearch.vue +99 -0
- package/app/components/CmsSection.vue +20 -0
- package/app/components/CmsSingletonForm.vue +283 -0
- package/app/components/CmsStatusBadge.vue +21 -0
- package/app/components/CmsTime.vue +16 -0
- package/app/components/CmsTranslationRef.vue +27 -0
- package/app/components/CmsTreeList.vue +453 -0
- package/app/components/CmsUnsavedText.vue +34 -0
- package/app/components/CmsWordmark.vue +10 -0
- package/app/composables/useCmsAdminHead.ts +18 -0
- package/app/composables/useCmsCollab.ts +165 -0
- package/app/composables/useCmsConfirm.ts +39 -0
- package/app/composables/useCmsEntryActions.ts +75 -0
- package/app/composables/useCmsFocus.ts +13 -0
- package/app/composables/useCmsForm.ts +273 -0
- package/app/composables/useCmsI18n.ts +185 -0
- package/app/composables/useCmsLinkTargets.ts +84 -0
- package/app/composables/useCmsLive.ts +199 -0
- package/app/composables/useCmsSearch.ts +62 -0
- package/app/composables/useCmsSeo.ts +99 -0
- package/app/composables/useCmsSignedIn.ts +24 -0
- package/app/composables/useCmsUiLocale.ts +24 -0
- package/app/i18n/cs.ts +781 -0
- package/app/i18n/de.ts +781 -0
- package/app/i18n/en.ts +782 -0
- package/app/i18n/types.ts +22 -0
- package/app/layouts/admin.vue +224 -0
- package/app/layouts/cms-auth.vue +37 -0
- package/app/middleware/cms-api-not-a-page.global.ts +10 -0
- package/app/middleware/cms-auth.global.ts +16 -0
- package/app/pages/admin/[entity]/[id].vue +1109 -0
- package/app/pages/admin/[entity]/index.vue +733 -0
- package/app/pages/admin/account.vue +117 -0
- package/app/pages/admin/forgot.vue +50 -0
- package/app/pages/admin/index.vue +184 -0
- package/app/pages/admin/invite/[token].vue +73 -0
- package/app/pages/admin/login.vue +84 -0
- package/app/pages/admin/media.vue +494 -0
- package/app/pages/admin/privacy.vue +193 -0
- package/app/pages/admin/reset/[token].vue +52 -0
- package/app/pages/admin/setup.vue +87 -0
- package/app/pages/admin/styleguide.vue +261 -0
- package/app/pages/admin/team.vue +258 -0
- package/app/plugins/cmsLivePreview.client.ts +20 -0
- package/app/plugins/cmsSignedOut.client.ts +31 -0
- package/app/utils/cmsBlockType.ts +11 -0
- package/app/utils/cmsBrand.ts +38 -0
- package/app/utils/cmsDiff.ts +83 -0
- package/app/utils/cmsFetch.ts +7 -0
- package/app/utils/cmsFocusInvalid.ts +22 -0
- package/app/utils/cmsIssues.ts +128 -0
- package/app/utils/cmsJson.ts +28 -0
- package/app/utils/cmsMedia.ts +63 -0
- package/app/utils/cmsSections.ts +154 -0
- package/app/utils/cmsTime.ts +41 -0
- package/cli/backup.ts +713 -0
- package/cli/breaking.ts +174 -0
- package/cli/content-migrate.ts +239 -0
- package/cli/db.ts +86 -0
- package/cli/export.ts +336 -0
- package/cli/generate.ts +146 -0
- package/cli/import.ts +643 -0
- package/cli/index.ts +140 -0
- package/cli/links-convert.ts +291 -0
- package/cli/seed-engine.ts +705 -0
- package/cli/seed.ts +339 -0
- package/cli/status.ts +49 -0
- package/cli/tar.ts +304 -0
- package/cli/transfer.ts +677 -0
- package/cli/up.ts +27 -0
- package/cli/upgrade.ts +60 -0
- package/cli/versions.ts +60 -0
- package/forms/components/CmsForm.vue +186 -0
- package/forms/index.ts +203 -0
- package/forms/messages.ts +104 -0
- package/forms/retention.ts +48 -0
- package/forms/server/form.get.ts +12 -0
- package/forms/server/form.post.ts +109 -0
- package/forms/server/formSettings.ts +12 -0
- package/forms/server/forms.ts +127 -0
- package/module.ts +373 -0
- package/nuxt.config.ts +43 -0
- package/package.json +99 -3
- package/server/api/cms/[entity]/[id]/revisions/[rev].get.ts +19 -0
- package/server/api/cms/[entity]/[id]/revisions/index.get.ts +14 -0
- package/server/api/cms/[entity]/[id].delete.ts +52 -0
- package/server/api/cms/[entity]/[id].get.ts +21 -0
- package/server/api/cms/[entity]/[id].patch.ts +116 -0
- package/server/api/cms/[entity]/_export.get.ts +69 -0
- package/server/api/cms/[entity]/_move.post.ts +81 -0
- package/server/api/cms/[entity]/_order.post.ts +49 -0
- package/server/api/cms/[entity]/_tree.get.ts +41 -0
- package/server/api/cms/[entity]/index.get.ts +62 -0
- package/server/api/cms/[entity]/index.post.ts +38 -0
- package/server/api/cms/[entity]/options.get.ts +55 -0
- package/server/api/cms/_auth/accept.post.ts +33 -0
- package/server/api/cms/_auth/forgot.post.ts +39 -0
- package/server/api/cms/_auth/invite/[token].get.ts +18 -0
- package/server/api/cms/_auth/login.post.ts +42 -0
- package/server/api/cms/_auth/logout.post.ts +7 -0
- package/server/api/cms/_auth/me.get.ts +5 -0
- package/server/api/cms/_auth/me.patch.ts +32 -0
- package/server/api/cms/_auth/password.post.ts +29 -0
- package/server/api/cms/_auth/reset.post.ts +34 -0
- package/server/api/cms/_auth/setup.post.ts +46 -0
- package/server/api/cms/_auth/status.get.ts +18 -0
- package/server/api/cms/_collab/session.get.ts +30 -0
- package/server/api/cms/_collab/socket.ts +51 -0
- package/server/api/cms/_collab/unsaved.delete.ts +16 -0
- package/server/api/cms/_graph.get.ts +20 -0
- package/server/api/cms/_links/resolve.post.ts +17 -0
- package/server/api/cms/_links.get.ts +81 -0
- package/server/api/cms/_live.ts +30 -0
- package/server/api/cms/_media/[id]/usage.get.ts +14 -0
- package/server/api/cms/_media/[id].delete.ts +29 -0
- package/server/api/cms/_media/[id].get.ts +13 -0
- package/server/api/cms/_media/[id].patch.ts +64 -0
- package/server/api/cms/_media/exists.post.ts +15 -0
- package/server/api/cms/_media/img/[id]/[file].get.ts +42 -0
- package/server/api/cms/_media/index.get.ts +44 -0
- package/server/api/cms/_media/index.post.ts +147 -0
- package/server/api/cms/_media/raw/[...key].get.ts +85 -0
- package/server/api/cms/_media/raw/[...key].head.ts +2 -0
- package/server/api/cms/_overview.get.ts +87 -0
- package/server/api/cms/_preview.post.ts +17 -0
- package/server/api/cms/_privacy/delete.post.ts +14 -0
- package/server/api/cms/_privacy/export.post.ts +25 -0
- package/server/api/cms/_privacy/lookup.post.ts +27 -0
- package/server/api/cms/_search.get.ts +17 -0
- package/server/api/cms/_singleton/[name].get.ts +19 -0
- package/server/api/cms/_singleton/[name].put.ts +76 -0
- package/server/api/cms/_users/[id]/resend.post.ts +25 -0
- package/server/api/cms/_users/[id].delete.ts +21 -0
- package/server/api/cms/_users/[id].patch.ts +45 -0
- package/server/api/cms/_users/index.get.ts +28 -0
- package/server/api/cms/_users/index.post.ts +39 -0
- package/server/api/content/[entity]/[slug].get.ts +74 -0
- package/server/api/content/[entity]/index.get.ts +100 -0
- package/server/api/content/_global/[name].get.ts +23 -0
- package/server/api/content/_search.get.ts +28 -0
- package/server/api/content/_sitemap.get.ts +8 -0
- package/server/api/content/_tree/[entity].get.ts +31 -0
- package/server/api/content-types.ts.get.ts +17 -0
- package/server/api/health/live.get.ts +10 -0
- package/server/api/health/ready.get.ts +21 -0
- package/server/api/openapi.get.ts +48 -0
- package/server/api/openapi.json.get.ts +32 -0
- package/server/db/driver.ts +8 -0
- package/server/mail/mailer.ts +43 -0
- package/server/middleware/cms-0-headers.ts +37 -0
- package/server/middleware/cms-0-migrate-gate.ts +14 -0
- package/server/middleware/cms-csrf.ts +28 -0
- package/server/middleware/cms-limits.ts +20 -0
- package/server/middleware/cms-redirects.ts +21 -0
- package/server/middleware/cms-session.ts +41 -0
- package/server/middleware/cms-z-plugin-access.ts +15 -0
- package/server/plugins/cms-0-config-check.ts +35 -0
- package/server/plugins/cms-changes.ts +53 -0
- package/server/plugins/cms-content-etag.ts +21 -0
- package/server/plugins/cms-errors.ts +45 -0
- package/server/plugins/cms-migrate.ts +5 -0
- package/server/plugins/cms-plugins.ts +17 -0
- package/server/plugins/cms-search.ts +12 -0
- package/server/plugins/cms-setup-code.ts +15 -0
- package/server/routes/sitemap.xml.get.ts +25 -0
- package/server/store/redis.ts +95 -0
- package/server/store/types.ts +21 -0
- package/server/tasks/cms/retention.ts +10 -0
- package/server/tasks/cms/scheduled.ts +10 -0
- package/server/tasks/cms/search-reindex.ts +12 -0
- package/server/utils/cmsAudit.ts +29 -0
- package/server/utils/cmsAuth.ts +143 -0
- package/server/utils/cmsBlocks.ts +47 -0
- package/server/utils/cmsChanges.ts +222 -0
- package/server/utils/cmsCollab.ts +286 -0
- package/server/utils/cmsCollabServer.ts +451 -0
- package/server/utils/cmsCollate.ts +27 -0
- package/server/utils/cmsContent.ts +376 -0
- package/server/utils/cmsCrud.ts +361 -0
- package/server/utils/cmsCsv.ts +24 -0
- package/server/utils/cmsDb.ts +23 -0
- package/server/utils/cmsDemo.ts +36 -0
- package/server/utils/cmsEmails.ts +125 -0
- package/server/utils/cmsErrors.ts +40 -0
- package/server/utils/cmsFold.ts +17 -0
- package/server/utils/cmsImageSizes.ts +51 -0
- package/server/utils/cmsJson.ts +6 -0
- package/server/utils/cmsLinkAddress.ts +50 -0
- package/server/utils/cmsLinks.ts +248 -0
- package/server/utils/cmsListQuery.ts +93 -0
- package/server/utils/cmsLive.ts +392 -0
- package/server/utils/cmsLocales.ts +96 -0
- package/server/utils/cmsMail.ts +28 -0
- package/server/utils/cmsMediaGc.ts +188 -0
- package/server/utils/cmsMediaKeys.ts +62 -0
- package/server/utils/cmsMigrate.ts +86 -0
- package/server/utils/cmsPreviewDraft.ts +72 -0
- package/server/utils/cmsPrivacy.ts +176 -0
- package/server/utils/cmsPublished.ts +57 -0
- package/server/utils/cmsRange.ts +38 -0
- package/server/utils/cmsRateLimit.ts +82 -0
- package/server/utils/cmsRedirects.ts +160 -0
- package/server/utils/cmsRetention.ts +61 -0
- package/server/utils/cmsRevisions.ts +103 -0
- package/server/utils/cmsScheduler.ts +45 -0
- package/server/utils/cmsScrub.ts +107 -0
- package/server/utils/cmsSearch.ts +354 -0
- package/server/utils/cmsSession.ts +102 -0
- package/server/utils/cmsSetupCode.ts +97 -0
- package/server/utils/cmsSitemap.ts +176 -0
- package/server/utils/cmsStorage.ts +580 -0
- package/server/utils/cmsStore.ts +109 -0
- package/server/utils/cmsTooMany.ts +9 -0
- package/server/utils/cmsTranslationWrite.ts +186 -0
- package/server/utils/cmsTree.ts +251 -0
- package/server/utils/cmsTreeAddress.ts +65 -0
- package/server/utils/cmsUpload.ts +197 -0
- package/server/utils/cmsWebhooks.ts +101 -0
- package/shared/json.ts +11 -0
- package/shared/richtext-editor.ts +56 -0
- package/shared/richtext-normalize.ts +33 -0
- package/shared/richtext-paste.ts +151 -0
- package/shared/storage-delivery.ts +53 -0
- package/src/blocks.ts +624 -0
- package/src/changes.ts +54 -0
- package/src/content-shape.ts +340 -0
- package/src/deprecate.ts +64 -0
- package/src/descriptor.ts +149 -0
- package/src/docs.ts +27 -0
- package/src/emitter.ts +94 -0
- package/src/entity.ts +624 -0
- package/src/errorReport.ts +41 -0
- package/src/fields.ts +465 -0
- package/src/i18n.ts +26 -0
- package/src/index.ts +54 -0
- package/src/linkref.ts +31 -0
- package/src/links.ts +179 -0
- package/src/locales.ts +39 -0
- package/src/media.ts +48 -0
- package/src/migrate.ts +236 -0
- package/src/openapi.ts +377 -0
- package/src/paths.ts +88 -0
- package/src/plugin.ts +505 -0
- package/src/presets.ts +230 -0
- package/src/richtext.ts +88 -0
- package/src/sdk.ts +181 -0
- package/src/search.ts +312 -0
- package/src/seed.ts +225 -0
- package/src/setupCode.ts +30 -0
- package/src/system.ts +219 -0
- package/src/tree.ts +421 -0
- package/src/upgrades.ts +137 -0
- package/starter/.env.example +10 -0
- package/starter/README.md +65 -0
- package/starter/app/app.config.ts +10 -0
- package/starter/app/app.vue +12 -0
- package/starter/app/assets/css/main.css +15 -0
- package/starter/app/components/global/BlockContact.vue +15 -0
- package/starter/app/components/global/BlockCta.vue +15 -0
- package/starter/app/components/global/BlockHero.vue +23 -0
- package/starter/app/components/global/BlockImage.vue +13 -0
- package/starter/app/components/global/BlockText.vue +12 -0
- package/starter/app/composables/useSite.ts +77 -0
- package/starter/app/error.vue +28 -0
- package/starter/app/layouts/default.vue +106 -0
- package/starter/app/lib/cms-content.ts +152 -0
- package/starter/app/pages/[...slug].vue +66 -0
- package/starter/app/pages/hledat.vue +59 -0
- package/starter/app/pages/index.vue +20 -0
- package/starter/cms.config.ts +137 -0
- package/starter/compose.yaml +15 -0
- package/starter/drizzle.config.ts +8 -0
- package/starter/gitignore.txt +8 -0
- package/starter/nuxt.config.ts +13 -0
- package/starter/package.json +38 -0
- package/starter/scripts/typecheck.mjs +38 -0
- package/starter/seed/index.ts +297 -0
- package/starter/seed/media/about.jpg +0 -0
- package/starter/seed/media/hero.jpg +0 -0
- package/starter/seed/media/logo.png +0 -0
- package/starter/seed/media/news-bread.jpg +0 -0
- package/starter/seed/media/news-morning.jpg +0 -0
- package/starter/server/db/migrations/0000_init.sql +269 -0
- package/starter/server/db/migrations/0001_page_tree.sql +5 -0
- package/starter/server/db/migrations/0002_opening_hours_per_language.sql +1 -0
- package/starter/server/db/migrations/meta/0000_snapshot.json +1890 -0
- package/starter/server/db/migrations/meta/0001_snapshot.json +1887 -0
- package/starter/server/db/migrations/meta/0002_snapshot.json +1893 -0
- package/starter/server/db/migrations/meta/_journal.json +27 -0
- package/starter/server/db/schema.ts +253 -0
- package/starter/server/plugins/sitemap.ts +11 -0
- package/starter/server/routes/robots.txt.get.ts +12 -0
- package/starter/tsconfig.json +9 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { defineSeed, type SeedEntry } from 'tinyzoo'
|
|
2
|
+
import { FormSettings, Navigation, News, Page, Redirect, SiteSettings } from '../cms.config'
|
|
3
|
+
|
|
4
|
+
// Demo content for the starter, in Czech and English: a small neighbourhood bakery.
|
|
5
|
+
// Put it into a running site with
|
|
6
|
+
//
|
|
7
|
+
// SEED_EMAIL=you@example.com SEED_PASSWORD=… pnpm seed
|
|
8
|
+
//
|
|
9
|
+
// (on a new site this creates the first administrator with those details). It is safe
|
|
10
|
+
// to run again: entries are recognised by their address, a file by its name, and
|
|
11
|
+
// whatever is already as written here is left alone. `pnpm seed --dry-run` shows what
|
|
12
|
+
// it would do, `pnpm seed --reset` removes this content first and writes it fresh.
|
|
13
|
+
//
|
|
14
|
+
// Replace the texts and pictures with your own, or delete this folder when the site has
|
|
15
|
+
// its real content. Pictures are drawn shapes (seed/media), free to use.
|
|
16
|
+
|
|
17
|
+
export default defineSeed(async (s) => {
|
|
18
|
+
const { doc, p, h2, ul, quote, bold, link, image } = s.rich
|
|
19
|
+
|
|
20
|
+
// ── pictures ──
|
|
21
|
+
const hero = await s.upload('seed/media/hero.jpg', {
|
|
22
|
+
alt: 'Slunce nad zvlněnou krajinou v teplých barvách', altLocales: { en: 'The sun over rolling hills in warm colours' }, focal: { x: 70, y: 40 },
|
|
23
|
+
})
|
|
24
|
+
const about = await s.upload('seed/media/about.jpg', {
|
|
25
|
+
alt: 'Tři klenutá okna a bochánky na pultu', altLocales: { en: 'Three arched windows and little loaves on a counter' },
|
|
26
|
+
})
|
|
27
|
+
const bread = await s.upload('seed/media/news-bread.jpg', {
|
|
28
|
+
alt: 'Bochník s naříznutou kůrkou', altLocales: { en: 'A loaf with a scored crust' },
|
|
29
|
+
})
|
|
30
|
+
const morning = await s.upload('seed/media/news-morning.jpg', {
|
|
31
|
+
alt: 'Východ slunce nad vodou', altLocales: { en: 'Sunrise over water' },
|
|
32
|
+
})
|
|
33
|
+
const logo = await s.upload('seed/media/logo.png', { alt: 'Logo pekárny', altLocales: { en: 'Bakery logo' } })
|
|
34
|
+
|
|
35
|
+
// ── pages ──
|
|
36
|
+
// A button that leads to a page of this seed is a reference to it (what the admin's link picker
|
|
37
|
+
// stores), so it follows the page when it is renamed or moved, in each language. The seed writes
|
|
38
|
+
// the same reference every run: a typed address ('/kontakt') would be written back over a link
|
|
39
|
+
// converted by `tinyzoo links:convert`. Pages the website draws itself (/aktuality) stay typed.
|
|
40
|
+
const refTo = (entry: SeedEntry) => s.link('', entry).url
|
|
41
|
+
// (`position` is the order in the page tree: the pages are written contact first, so say it.)
|
|
42
|
+
const contact = await s.upsert(Page, {
|
|
43
|
+
title: 'Kontakt', slug: 'kontakt', status: 'published', position: 2,
|
|
44
|
+
metaDescription: 'Adresa, otevírací doba a kontaktní formulář pekárny Na Růžku.',
|
|
45
|
+
sections: [
|
|
46
|
+
{
|
|
47
|
+
type: 'text',
|
|
48
|
+
body: doc(
|
|
49
|
+
h2('Zastavte se, nebo napište'),
|
|
50
|
+
p('Najdete nás na rohu u kostela v Dolní Lhotě. Na víkend je dobré objednat den předem, ať vám vyjde i vánočka.'),
|
|
51
|
+
),
|
|
52
|
+
},
|
|
53
|
+
{ type: 'contact', heading: 'Napište nám' },
|
|
54
|
+
],
|
|
55
|
+
}, {
|
|
56
|
+
translations: {
|
|
57
|
+
en: {
|
|
58
|
+
title: 'Contact', slug: 'contact',
|
|
59
|
+
metaDescription: 'Address, opening hours and the contact form of Corner Bakery.',
|
|
60
|
+
sections: [
|
|
61
|
+
{
|
|
62
|
+
type: 'text',
|
|
63
|
+
body: doc(
|
|
64
|
+
h2('Drop in, or write to us'),
|
|
65
|
+
p('You will find us on the corner by the church in Dolní Lhota. For the weekend it is best to order a day ahead, so there is a plaited loaf left for you.'),
|
|
66
|
+
),
|
|
67
|
+
},
|
|
68
|
+
{ type: 'contact', heading: 'Write to us' },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const aboutPage = await s.upsert(Page, {
|
|
75
|
+
title: 'O nás', slug: 'o-nas', status: 'published', position: 1,
|
|
76
|
+
metaDescription: 'Rodinná pekárna z Dolní Lhoty. Kdo pečeme, z čeho a proč to děláme v malém.',
|
|
77
|
+
sections: [
|
|
78
|
+
{
|
|
79
|
+
type: 'text',
|
|
80
|
+
body: doc(
|
|
81
|
+
h2('Rodinná pekárna z Dolní Lhoty'),
|
|
82
|
+
p('Pekárnu Na Růžku jsme otevřeli v roce 2014 v bývalé trafice. Dnes v ní pečou čtyři lidé a pec zná každý z nich zpaměti.'),
|
|
83
|
+
quote('Dobrý chléb se nedá uspěchat. Stačí mu dát čas a dobrou mouku.', 'Marie Kovářová, zakladatelka'),
|
|
84
|
+
p('Mouku bereme z mlýna o dvě vsi dál, mléko od místního statkáře. Co zbyde, odvážíme večer do chráněného bydlení v sousední obci.'),
|
|
85
|
+
),
|
|
86
|
+
},
|
|
87
|
+
{ type: 'image', image: bread, caption: 'Bochník těsně před pecí.' },
|
|
88
|
+
{ type: 'cta', heading: 'Přijďte ochutnat', buttonLabel: 'Kde nás najdete', buttonUrl: refTo(contact) },
|
|
89
|
+
],
|
|
90
|
+
}, {
|
|
91
|
+
translations: {
|
|
92
|
+
en: {
|
|
93
|
+
title: 'About us', slug: 'about',
|
|
94
|
+
metaDescription: 'A family bakery from Dolní Lhota: who bakes, with what, and why we keep it small.',
|
|
95
|
+
sections: [
|
|
96
|
+
{
|
|
97
|
+
type: 'text',
|
|
98
|
+
body: doc(
|
|
99
|
+
h2('A family bakery from Dolní Lhota'),
|
|
100
|
+
p('We opened Corner Bakery in 2014, in a former tobacconist\'s. Four people bake in it today, and every one of them knows the oven by heart.'),
|
|
101
|
+
quote('Good bread cannot be rushed. It just needs time and good flour.', 'Marie Kovářová, founder'),
|
|
102
|
+
p('Our flour comes from a mill two villages away and our milk from a local farmer. What is left over goes in the evening to a sheltered home in the next village.'),
|
|
103
|
+
),
|
|
104
|
+
},
|
|
105
|
+
{ type: 'image', image: bread, caption: 'A loaf just before the oven.' },
|
|
106
|
+
{ type: 'cta', heading: 'Come and taste', buttonLabel: 'Where to find us', buttonUrl: refTo(contact) },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
await s.upsert(Page, {
|
|
113
|
+
title: 'Úvod', slug: 'home', status: 'published', position: 0,
|
|
114
|
+
metaTitle: 'Pekárna Na Růžku · čerstvé pečivo z Dolní Lhoty',
|
|
115
|
+
metaDescription: 'Pečeme chleba na kvásku, rohlíky a sladké koláče každý den od půl šesté. Zastavte se na rohu u kostela.',
|
|
116
|
+
ogImage: hero,
|
|
117
|
+
sections: [
|
|
118
|
+
{
|
|
119
|
+
type: 'hero', heading: 'Chléb, který voní po ránu.',
|
|
120
|
+
text: 'Pečeme z české mouky a na vlastním kvásku. Každé ráno od půl šesté čerstvé pečivo na rohu u kostela.',
|
|
121
|
+
image: hero, buttonLabel: 'Co je nového', buttonUrl: '/aktuality',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
type: 'text',
|
|
125
|
+
body: doc(
|
|
126
|
+
h2('Pečeme po staru, v malém'),
|
|
127
|
+
p('Těsto necháváme přes noc kynout a pečeme v kamenné peci. Proto máme každý den jen tolik, kolik za ráno vyprodáme.'),
|
|
128
|
+
ul('chléb na kvásku, pšeničný i žitný', 'rohlíky, housky a vánočky', 'koláče a štrúdly podle sezóny'),
|
|
129
|
+
p('Něco chybí? ', bold('Napište nám'), ' a upečeme to na zakázku.'),
|
|
130
|
+
),
|
|
131
|
+
},
|
|
132
|
+
{ type: 'image', image: about, caption: 'Okna naší pekárny, každé ráno od půl šesté.' },
|
|
133
|
+
{ type: 'cta', heading: 'Objednejte si na víkend', buttonLabel: 'Napsat nám', buttonUrl: refTo(contact) },
|
|
134
|
+
],
|
|
135
|
+
}, {
|
|
136
|
+
translations: {
|
|
137
|
+
en: {
|
|
138
|
+
title: 'Home', slug: 'home',
|
|
139
|
+
metaTitle: 'Corner Bakery · fresh bread from Dolní Lhota',
|
|
140
|
+
metaDescription: 'Sourdough bread, rolls and sweet pastries baked every day from half past five. Find us on the corner by the church.',
|
|
141
|
+
sections: [
|
|
142
|
+
{
|
|
143
|
+
type: 'hero', heading: 'Bread that smells like morning.',
|
|
144
|
+
text: 'We bake with Czech flour and our own sourdough. Fresh bread every morning from half past five, on the corner by the church.',
|
|
145
|
+
image: hero, buttonLabel: 'What is new', buttonUrl: '/en/news',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'text',
|
|
149
|
+
body: doc(
|
|
150
|
+
h2('Baked the old way, in small batches'),
|
|
151
|
+
p('The dough rises overnight and goes into a stone oven. That is why we only have as much each day as we sell by lunchtime.'),
|
|
152
|
+
ul('sourdough bread, wheat and rye', 'rolls, buns and plaited loaves', 'pastries and strudels by the season'),
|
|
153
|
+
p('Missing something? ', bold('Write to us'), ' and we will bake it to order.'),
|
|
154
|
+
),
|
|
155
|
+
},
|
|
156
|
+
{ type: 'image', image: about, caption: 'The windows of our bakery, open from half past five.' },
|
|
157
|
+
{ type: 'cta', heading: 'Order for the weekend', buttonLabel: 'Write to us', buttonUrl: refTo(contact) },
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
// ── news ──
|
|
164
|
+
// (fixed dates, so a second run changes nothing)
|
|
165
|
+
await s.upsert(News, {
|
|
166
|
+
title: 'Nový žitný chléb s ořechy', slug: 'novy-zitny-chleb', status: 'published', publishedAt: '2026-10-12T06:30:00Z',
|
|
167
|
+
cover: bread,
|
|
168
|
+
perex: 'Od tohoto týdne pečeme žitný chléb s vlašskými ořechy a sušenými švestkami. Hotový je v sedm.',
|
|
169
|
+
body: doc(
|
|
170
|
+
p('Dlouho jsme ho zkoušeli a teď je hotový: tmavý žitný chléb na kvásku s vlašskými ořechy a sušenými švestkami z blízkého sadu.'),
|
|
171
|
+
h2('Kdy ho máte čekat'),
|
|
172
|
+
p('Pečeme ho v úterý, ve čtvrtek a v sobotu, vždy kolem sedmé ranní. Pokud ho chcete jistě, rezervujte si ho předem.'),
|
|
173
|
+
p('Dejte nám vědět, jak chutná.'),
|
|
174
|
+
),
|
|
175
|
+
metaDescription: 'Žitný chléb s vlašskými ořechy a sušenými švestkami, nově od října.',
|
|
176
|
+
}, {
|
|
177
|
+
translations: {
|
|
178
|
+
en: {
|
|
179
|
+
title: 'A new rye bread with walnuts', slug: 'new-rye-bread',
|
|
180
|
+
perex: 'From this week we bake a rye bread with walnuts and dried plums. It comes out of the oven at seven.',
|
|
181
|
+
body: doc(
|
|
182
|
+
p('We tried it for a long time and now it is ready: a dark rye sourdough bread with walnuts and dried plums from a nearby orchard.'),
|
|
183
|
+
h2('When to expect it'),
|
|
184
|
+
p('We bake it on Tuesdays, Thursdays and Saturdays, always around seven in the morning. If you want to be sure of one, reserve it ahead.'),
|
|
185
|
+
p('Let us know how it tastes.'),
|
|
186
|
+
),
|
|
187
|
+
metaDescription: 'A rye bread with walnuts and dried plums, new from October.',
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
await s.upsert(News, {
|
|
193
|
+
title: 'Slunce nad pecí: otevíráme už v pět', slug: 'otevirame-v-pet', status: 'published', publishedAt: '2026-11-02T05:00:00Z',
|
|
194
|
+
cover: morning,
|
|
195
|
+
perex: 'Přes zimu otevíráme o půl hodiny dřív, aby si pečivo stihli odnést i ti, kdo jedou na první autobus.',
|
|
196
|
+
body: doc(
|
|
197
|
+
p('Od listopadu je pult otevřený už od půl šesté, ještě před prvním autobusem do města.'),
|
|
198
|
+
p('Čerstvé rohlíky a housky jsou hotové vždy před šestou, chléb se dopéká do sedmi.'),
|
|
199
|
+
p(link('Otevírací dobu najdete na stránce Kontakt', '/kontakt')),
|
|
200
|
+
),
|
|
201
|
+
}, {
|
|
202
|
+
translations: {
|
|
203
|
+
en: {
|
|
204
|
+
title: 'Sun over the oven: we now open at five thirty', slug: 'now-open-at-half-five',
|
|
205
|
+
perex: 'Over the winter we open half an hour earlier, so that people catching the first bus can pick up bread too.',
|
|
206
|
+
body: doc(
|
|
207
|
+
p('From November the counter opens at half past five, before the first bus into town.'),
|
|
208
|
+
p('Fresh rolls and buns are ready before six; the bread keeps baking until seven.'),
|
|
209
|
+
p(link('Opening hours are on the Contact page', '/en/contact')),
|
|
210
|
+
),
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
await s.upsert(News, {
|
|
216
|
+
title: 'Jak vzniká kvásek', slug: 'jak-vznika-kvasek', status: 'published', publishedAt: '2026-11-09T07:00:00Z',
|
|
217
|
+
cover: about,
|
|
218
|
+
perex: 'Náš kvásek je starý dvanáct let a krmíme ho každý den. Zeptali jste se, jak to děláme.',
|
|
219
|
+
body: doc(
|
|
220
|
+
p('Kvásek je jen mouka a voda, které necháte dost času. Ten náš každý večer dostane novou dávku žitné mouky a čistou vodu.'),
|
|
221
|
+
image(about, 'Tři klenutá okna a bochánky na pultu'),
|
|
222
|
+
p('Pokud si chcete doma zkusit upéct vlastní chléb, rádi vám kousek kvásku dáme.'),
|
|
223
|
+
),
|
|
224
|
+
}, {
|
|
225
|
+
translations: {
|
|
226
|
+
en: {
|
|
227
|
+
title: 'How sourdough is made', slug: 'how-sourdough-is-made',
|
|
228
|
+
perex: 'Our starter is twelve years old and we feed it every day. You asked how we do it.',
|
|
229
|
+
body: doc(
|
|
230
|
+
p('Sourdough is just flour and water given enough time. Ours gets a fresh portion of rye flour and clean water every evening.'),
|
|
231
|
+
image(about, 'Three arched windows and little loaves on a counter'),
|
|
232
|
+
p('If you would like to try baking your own bread at home, we will gladly give you a bit of our starter.'),
|
|
233
|
+
),
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
// One draft: the admin shows every state of an entry.
|
|
239
|
+
await s.upsert(News, {
|
|
240
|
+
title: 'Připravujeme vánoční štoly', slug: 'vanocni-stoly', status: 'draft',
|
|
241
|
+
perex: 'Od prvního adventu upečeme štoly s mandlemi a rozinkami. Objednávky přijímáme od prosince.',
|
|
242
|
+
body: doc(p('Tento text je zatím rozepsaný. Zveřejníte ho v administraci tlačítkem Zveřejnit.')),
|
|
243
|
+
}, {
|
|
244
|
+
translations: {
|
|
245
|
+
en: { title: 'Christmas stollen are coming', slug: 'christmas-stollen', perex: 'From the first Sunday of Advent we bake stollen with almonds and raisins. Orders open in December.', body: doc(p('This text is still a draft. Publish it in the admin with the Publish button.')) },
|
|
246
|
+
},
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
// ── menus, settings, forms ──
|
|
250
|
+
await s.global(Navigation, {
|
|
251
|
+
main: [s.link('Úvod', '/'), s.link('Aktuality', '/aktuality'), s.link('O nás', aboutPage), s.link('Kontakt', contact)],
|
|
252
|
+
footer: [s.link('Kontakt', contact), s.link('Hledat', '/hledat')],
|
|
253
|
+
}, {
|
|
254
|
+
translations: {
|
|
255
|
+
en: {
|
|
256
|
+
main: [s.link('Home', '/en'), s.link('News', '/en/news'), s.link('About us', aboutPage, { locale: 'en' }), s.link('Contact', contact, { locale: 'en' })],
|
|
257
|
+
footer: [s.link('Contact', contact, { locale: 'en' }), s.link('Search', '/en/search')],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
await s.global(SiteSettings, {
|
|
263
|
+
siteName: 'Pekárna Na Růžku',
|
|
264
|
+
tagline: 'Čerstvé pečivo každý den od půl šesté.',
|
|
265
|
+
logo,
|
|
266
|
+
email: 'info@narozku.example',
|
|
267
|
+
phone: '+420 600 000 000',
|
|
268
|
+
address: 'Pekárna Na Růžku\nU kostela 12\n123 45 Dolní Lhota',
|
|
269
|
+
openingHours: [
|
|
270
|
+
{ days: 'Po–Pá', hours: '5:30–17:00' },
|
|
271
|
+
{ days: 'So', hours: '6:00–12:00' },
|
|
272
|
+
{ days: 'Ne', hours: '7:00–10:00' },
|
|
273
|
+
],
|
|
274
|
+
metaTitle: 'Pekárna Na Růžku',
|
|
275
|
+
metaDescription: 'Rodinná pekárna z Dolní Lhoty: chléb na kvásku, rohlíky a koláče každý den od půl šesté.',
|
|
276
|
+
ogImage: hero,
|
|
277
|
+
}, {
|
|
278
|
+
translations: {
|
|
279
|
+
en: {
|
|
280
|
+
tagline: 'Fresh bread every day from half past five.',
|
|
281
|
+
openingHours: [
|
|
282
|
+
{ days: 'Mon–Fri', hours: '5:30–17:00' },
|
|
283
|
+
{ days: 'Sat', hours: '6:00–12:00' },
|
|
284
|
+
{ days: 'Sun', hours: '7:00–10:00' },
|
|
285
|
+
],
|
|
286
|
+
metaTitle: 'Corner Bakery',
|
|
287
|
+
metaDescription: 'A family bakery from Dolní Lhota: sourdough bread, rolls and pastries every day from half past five.',
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
// Who is told about messages from the contact form (replace with your own address).
|
|
293
|
+
await s.global(FormSettings, { notifyTo: [{ email: 'info@narozku.example' }] })
|
|
294
|
+
|
|
295
|
+
// An old address that now leads to the new one.
|
|
296
|
+
await s.upsert(Redirect, { from: '/pekarna', to: '/o-nas', permanent: true }, { by: 'from' })
|
|
297
|
+
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
CREATE EXTENSION IF NOT EXISTS pg_trgm;--> statement-breakpoint
|
|
2
|
+
CREATE TYPE "public"."contact_form_status" AS ENUM('new', 'read', 'done');--> statement-breakpoint
|
|
3
|
+
CREATE TYPE "public"."news_status" AS ENUM('draft', 'published');--> statement-breakpoint
|
|
4
|
+
CREATE TYPE "public"."page_status" AS ENUM('draft', 'published');--> statement-breakpoint
|
|
5
|
+
CREATE TABLE "cms_audit" (
|
|
6
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
7
|
+
"user_id" uuid,
|
|
8
|
+
"action" text NOT NULL,
|
|
9
|
+
"entity" text,
|
|
10
|
+
"record_id" text,
|
|
11
|
+
"meta" jsonb,
|
|
12
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
13
|
+
);
|
|
14
|
+
--> statement-breakpoint
|
|
15
|
+
CREATE TABLE "cms_collab" (
|
|
16
|
+
"name" text PRIMARY KEY NOT NULL,
|
|
17
|
+
"epoch" uuid NOT NULL,
|
|
18
|
+
"state" text NOT NULL,
|
|
19
|
+
"base_version" timestamp (3) with time zone,
|
|
20
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
21
|
+
"active_at" timestamp (3) with time zone
|
|
22
|
+
);
|
|
23
|
+
--> statement-breakpoint
|
|
24
|
+
CREATE TABLE "cms_media" (
|
|
25
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
26
|
+
"url" text NOT NULL,
|
|
27
|
+
"key" text NOT NULL,
|
|
28
|
+
"mime" text NOT NULL,
|
|
29
|
+
"size" integer NOT NULL,
|
|
30
|
+
"width" integer,
|
|
31
|
+
"height" integer,
|
|
32
|
+
"alt" text,
|
|
33
|
+
"alt_locales" jsonb,
|
|
34
|
+
"name" text,
|
|
35
|
+
"folder" text,
|
|
36
|
+
"focal_x" integer,
|
|
37
|
+
"focal_y" integer,
|
|
38
|
+
"uploaded_by" uuid,
|
|
39
|
+
"in_library" boolean DEFAULT false NOT NULL,
|
|
40
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
41
|
+
);
|
|
42
|
+
--> statement-breakpoint
|
|
43
|
+
CREATE TABLE "cms_revisions" (
|
|
44
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
45
|
+
"entity" text NOT NULL,
|
|
46
|
+
"record_id" uuid NOT NULL,
|
|
47
|
+
"locale" text,
|
|
48
|
+
"action" text NOT NULL,
|
|
49
|
+
"version" timestamp (3) with time zone,
|
|
50
|
+
"data" jsonb NOT NULL,
|
|
51
|
+
"changed" jsonb NOT NULL,
|
|
52
|
+
"user_id" uuid,
|
|
53
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
54
|
+
);
|
|
55
|
+
--> statement-breakpoint
|
|
56
|
+
CREATE TABLE "cms_search" (
|
|
57
|
+
"entity" text NOT NULL,
|
|
58
|
+
"record_id" uuid NOT NULL,
|
|
59
|
+
"locale" text DEFAULT '' NOT NULL,
|
|
60
|
+
"title" text DEFAULT '' NOT NULL,
|
|
61
|
+
"body" text DEFAULT '' NOT NULL,
|
|
62
|
+
"extra" text DEFAULT '' NOT NULL,
|
|
63
|
+
"title_folded" text DEFAULT '' NOT NULL,
|
|
64
|
+
"body_folded" text DEFAULT '' NOT NULL,
|
|
65
|
+
"extra_folded" text DEFAULT '' NOT NULL,
|
|
66
|
+
"path" text,
|
|
67
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
68
|
+
CONSTRAINT "cms_search_pk" PRIMARY KEY("entity","record_id","locale")
|
|
69
|
+
);
|
|
70
|
+
--> statement-breakpoint
|
|
71
|
+
CREATE TABLE "cms_state" (
|
|
72
|
+
"key" text PRIMARY KEY NOT NULL,
|
|
73
|
+
"value" jsonb NOT NULL,
|
|
74
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
75
|
+
);
|
|
76
|
+
--> statement-breakpoint
|
|
77
|
+
CREATE TABLE "cms_tokens" (
|
|
78
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
79
|
+
"user_id" uuid NOT NULL,
|
|
80
|
+
"kind" text NOT NULL,
|
|
81
|
+
"token_hash" text NOT NULL,
|
|
82
|
+
"expires_at" timestamp (3) with time zone NOT NULL,
|
|
83
|
+
"used_at" timestamp (3) with time zone,
|
|
84
|
+
"created_by" uuid,
|
|
85
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
86
|
+
);
|
|
87
|
+
--> statement-breakpoint
|
|
88
|
+
CREATE TABLE "cms_users" (
|
|
89
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
90
|
+
"email" text NOT NULL,
|
|
91
|
+
"name" text DEFAULT '' NOT NULL,
|
|
92
|
+
"role" text DEFAULT 'editor' NOT NULL,
|
|
93
|
+
"status" text DEFAULT 'invited' NOT NULL,
|
|
94
|
+
"password_hash" text,
|
|
95
|
+
"locale" text,
|
|
96
|
+
"session_version" integer DEFAULT 0 NOT NULL,
|
|
97
|
+
"last_login_at" timestamp (3) with time zone,
|
|
98
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
99
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
100
|
+
);
|
|
101
|
+
--> statement-breakpoint
|
|
102
|
+
CREATE TABLE "contact_form" (
|
|
103
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
104
|
+
"name" text NOT NULL,
|
|
105
|
+
"email" text NOT NULL,
|
|
106
|
+
"message" text NOT NULL,
|
|
107
|
+
"status" "contact_form_status" DEFAULT 'new' NOT NULL,
|
|
108
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
109
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
110
|
+
"created_by" uuid,
|
|
111
|
+
"updated_by" uuid
|
|
112
|
+
);
|
|
113
|
+
--> statement-breakpoint
|
|
114
|
+
CREATE TABLE "form_settings" (
|
|
115
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
116
|
+
"notify_to" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
117
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
118
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
119
|
+
"created_by" uuid,
|
|
120
|
+
"updated_by" uuid
|
|
121
|
+
);
|
|
122
|
+
--> statement-breakpoint
|
|
123
|
+
CREATE TABLE "navigation" (
|
|
124
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
125
|
+
"main" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
126
|
+
"footer" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
127
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
128
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
129
|
+
"created_by" uuid,
|
|
130
|
+
"updated_by" uuid
|
|
131
|
+
);
|
|
132
|
+
--> statement-breakpoint
|
|
133
|
+
CREATE TABLE "navigation_locales" (
|
|
134
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
135
|
+
"parent_id" uuid NOT NULL,
|
|
136
|
+
"locale" text NOT NULL,
|
|
137
|
+
"main" jsonb,
|
|
138
|
+
"footer" jsonb,
|
|
139
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
140
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
141
|
+
);
|
|
142
|
+
--> statement-breakpoint
|
|
143
|
+
CREATE TABLE "news" (
|
|
144
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
145
|
+
"title" text NOT NULL,
|
|
146
|
+
"slug" text NOT NULL,
|
|
147
|
+
"status" "news_status" DEFAULT 'draft' NOT NULL,
|
|
148
|
+
"published_at" timestamp (3) with time zone,
|
|
149
|
+
"cover_id" uuid,
|
|
150
|
+
"perex" text,
|
|
151
|
+
"body" jsonb NOT NULL,
|
|
152
|
+
"meta_title" text,
|
|
153
|
+
"meta_description" text,
|
|
154
|
+
"og_image_id" uuid,
|
|
155
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
156
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
157
|
+
"created_by" uuid,
|
|
158
|
+
"updated_by" uuid,
|
|
159
|
+
CONSTRAINT "news_slug_unique" UNIQUE("slug")
|
|
160
|
+
);
|
|
161
|
+
--> statement-breakpoint
|
|
162
|
+
CREATE TABLE "news_locales" (
|
|
163
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
164
|
+
"parent_id" uuid NOT NULL,
|
|
165
|
+
"locale" text NOT NULL,
|
|
166
|
+
"title" text,
|
|
167
|
+
"slug" text,
|
|
168
|
+
"perex" text,
|
|
169
|
+
"body" jsonb,
|
|
170
|
+
"meta_title" text,
|
|
171
|
+
"meta_description" text,
|
|
172
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
173
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
174
|
+
);
|
|
175
|
+
--> statement-breakpoint
|
|
176
|
+
CREATE TABLE "page" (
|
|
177
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
178
|
+
"title" text NOT NULL,
|
|
179
|
+
"slug" text NOT NULL,
|
|
180
|
+
"status" "page_status" DEFAULT 'draft' NOT NULL,
|
|
181
|
+
"sections" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
182
|
+
"meta_title" text,
|
|
183
|
+
"meta_description" text,
|
|
184
|
+
"og_image_id" uuid,
|
|
185
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
186
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
187
|
+
"created_by" uuid,
|
|
188
|
+
"updated_by" uuid,
|
|
189
|
+
CONSTRAINT "page_slug_unique" UNIQUE("slug")
|
|
190
|
+
);
|
|
191
|
+
--> statement-breakpoint
|
|
192
|
+
CREATE TABLE "page_locales" (
|
|
193
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
194
|
+
"parent_id" uuid NOT NULL,
|
|
195
|
+
"locale" text NOT NULL,
|
|
196
|
+
"title" text,
|
|
197
|
+
"slug" text,
|
|
198
|
+
"sections" jsonb,
|
|
199
|
+
"meta_title" text,
|
|
200
|
+
"meta_description" text,
|
|
201
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
202
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
203
|
+
);
|
|
204
|
+
--> statement-breakpoint
|
|
205
|
+
CREATE TABLE "redirect" (
|
|
206
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
207
|
+
"from" text NOT NULL,
|
|
208
|
+
"to" text NOT NULL,
|
|
209
|
+
"permanent" boolean DEFAULT true NOT NULL,
|
|
210
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
211
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
212
|
+
"created_by" uuid,
|
|
213
|
+
"updated_by" uuid,
|
|
214
|
+
CONSTRAINT "redirect_from_unique" UNIQUE("from")
|
|
215
|
+
);
|
|
216
|
+
--> statement-breakpoint
|
|
217
|
+
CREATE TABLE "site_settings" (
|
|
218
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
219
|
+
"site_name" text NOT NULL,
|
|
220
|
+
"tagline" text,
|
|
221
|
+
"logo_id" uuid,
|
|
222
|
+
"email" text,
|
|
223
|
+
"phone" text,
|
|
224
|
+
"address" text,
|
|
225
|
+
"opening_hours" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
226
|
+
"meta_title" text,
|
|
227
|
+
"meta_description" text,
|
|
228
|
+
"og_image_id" uuid,
|
|
229
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
230
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
231
|
+
"created_by" uuid,
|
|
232
|
+
"updated_by" uuid
|
|
233
|
+
);
|
|
234
|
+
--> statement-breakpoint
|
|
235
|
+
CREATE TABLE "site_settings_locales" (
|
|
236
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
237
|
+
"parent_id" uuid NOT NULL,
|
|
238
|
+
"locale" text NOT NULL,
|
|
239
|
+
"tagline" text,
|
|
240
|
+
"meta_title" text,
|
|
241
|
+
"meta_description" text,
|
|
242
|
+
"created_at" timestamp (3) with time zone DEFAULT now() NOT NULL,
|
|
243
|
+
"updated_at" timestamp (3) with time zone DEFAULT now() NOT NULL
|
|
244
|
+
);
|
|
245
|
+
--> statement-breakpoint
|
|
246
|
+
ALTER TABLE "cms_tokens" ADD CONSTRAINT "cms_tokens_user_id_cms_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."cms_users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
247
|
+
ALTER TABLE "navigation_locales" ADD CONSTRAINT "navigation_locales_parent_id_navigation_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."navigation"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
248
|
+
ALTER TABLE "news" ADD CONSTRAINT "news_cover_id_cms_media_id_fk" FOREIGN KEY ("cover_id") REFERENCES "public"."cms_media"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
249
|
+
ALTER TABLE "news" ADD CONSTRAINT "news_og_image_id_cms_media_id_fk" FOREIGN KEY ("og_image_id") REFERENCES "public"."cms_media"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
250
|
+
ALTER TABLE "news_locales" ADD CONSTRAINT "news_locales_parent_id_news_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."news"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
251
|
+
ALTER TABLE "page" ADD CONSTRAINT "page_og_image_id_cms_media_id_fk" FOREIGN KEY ("og_image_id") REFERENCES "public"."cms_media"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
252
|
+
ALTER TABLE "page_locales" ADD CONSTRAINT "page_locales_parent_id_page_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."page"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
253
|
+
ALTER TABLE "site_settings" ADD CONSTRAINT "site_settings_logo_id_cms_media_id_fk" FOREIGN KEY ("logo_id") REFERENCES "public"."cms_media"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
254
|
+
ALTER TABLE "site_settings" ADD CONSTRAINT "site_settings_og_image_id_cms_media_id_fk" FOREIGN KEY ("og_image_id") REFERENCES "public"."cms_media"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
255
|
+
ALTER TABLE "site_settings_locales" ADD CONSTRAINT "site_settings_locales_parent_id_site_settings_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."site_settings"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
256
|
+
CREATE INDEX "cms_audit_created_idx" ON "cms_audit" USING btree ("created_at");--> statement-breakpoint
|
|
257
|
+
CREATE INDEX "cms_revisions_record_idx" ON "cms_revisions" USING btree ("entity","record_id","locale","created_at");--> statement-breakpoint
|
|
258
|
+
CREATE INDEX "cms_search_title_trgm" ON "cms_search" USING gin ("title_folded" gin_trgm_ops);--> statement-breakpoint
|
|
259
|
+
CREATE INDEX "cms_search_body_trgm" ON "cms_search" USING gin ("body_folded" gin_trgm_ops);--> statement-breakpoint
|
|
260
|
+
CREATE INDEX "cms_search_extra_trgm" ON "cms_search" USING gin ("extra_folded" gin_trgm_ops);--> statement-breakpoint
|
|
261
|
+
CREATE UNIQUE INDEX "cms_tokens_hash_unique" ON "cms_tokens" USING btree ("token_hash");--> statement-breakpoint
|
|
262
|
+
CREATE INDEX "cms_tokens_user_idx" ON "cms_tokens" USING btree ("user_id");--> statement-breakpoint
|
|
263
|
+
CREATE UNIQUE INDEX "cms_users_email_unique" ON "cms_users" USING btree ("email");--> statement-breakpoint
|
|
264
|
+
CREATE UNIQUE INDEX "navigation_locales_parent_locale_unique" ON "navigation_locales" USING btree ("parent_id","locale");--> statement-breakpoint
|
|
265
|
+
CREATE UNIQUE INDEX "news_locales_parent_locale_unique" ON "news_locales" USING btree ("parent_id","locale");--> statement-breakpoint
|
|
266
|
+
CREATE UNIQUE INDEX "news_locales_slug_unique" ON "news_locales" USING btree ("locale","slug");--> statement-breakpoint
|
|
267
|
+
CREATE UNIQUE INDEX "page_locales_parent_locale_unique" ON "page_locales" USING btree ("parent_id","locale");--> statement-breakpoint
|
|
268
|
+
CREATE UNIQUE INDEX "page_locales_slug_unique" ON "page_locales" USING btree ("locale","slug");--> statement-breakpoint
|
|
269
|
+
CREATE UNIQUE INDEX "site_settings_locales_parent_locale_unique" ON "site_settings_locales" USING btree ("parent_id","locale");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ALTER TABLE "page" DROP CONSTRAINT "page_slug_unique";--> statement-breakpoint
|
|
2
|
+
DROP INDEX "page_locales_slug_unique";--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "page" ADD COLUMN "parent_id" uuid;--> statement-breakpoint
|
|
4
|
+
ALTER TABLE "page" ADD COLUMN "position" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
|
5
|
+
ALTER TABLE "page" ADD CONSTRAINT "page_parent_id_page_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."page"("id") ON DELETE restrict ON UPDATE no action;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "site_settings_locales" ADD COLUMN "opening_hours" jsonb;
|