feat: live preview
This commit is contained in:
parent
267e3f9e05
commit
a64251f439
25 changed files with 30568 additions and 150 deletions
25
package-lock.json
generated
25
package-lock.json
generated
|
|
@ -22,7 +22,6 @@
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"next": "15.4.11",
|
"next": "15.4.11",
|
||||||
"payload": "^3.74.0",
|
"payload": "^3.74.0",
|
||||||
"qs-esm": "^7.0.3",
|
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4",
|
"react-dom": "19.2.4",
|
||||||
"resend": "^6.9.1",
|
"resend": "^6.9.1",
|
||||||
|
|
@ -2143,18 +2142,18 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@payloadcms/live-preview": {
|
"node_modules/@payloadcms/live-preview": {
|
||||||
"version": "3.79.0",
|
"version": "3.74.0",
|
||||||
"resolved": "https://registry.npmjs.org/@payloadcms/live-preview/-/live-preview-3.79.0.tgz",
|
"resolved": "https://registry.npmjs.org/@payloadcms/live-preview/-/live-preview-3.74.0.tgz",
|
||||||
"integrity": "sha512-Y2t6NACgeC4gZV/mwzD1L+OhJHematK0RQ8xK4P/m+8fhO+sgS4gtjpA/m6yqAkhruRTni5izZJK6SWTB9pXPw==",
|
"integrity": "sha512-pp77TUCSajma2ml9d0oxgaRf4PySDhkzn7bK9OrjPBI+mAYC72K7FwAAeBYidn8REfgaCwS1hMAv52IUskxRWA==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@payloadcms/live-preview-react": {
|
"node_modules/@payloadcms/live-preview-react": {
|
||||||
"version": "3.79.0",
|
"version": "3.74.0",
|
||||||
"resolved": "https://registry.npmjs.org/@payloadcms/live-preview-react/-/live-preview-react-3.79.0.tgz",
|
"resolved": "https://registry.npmjs.org/@payloadcms/live-preview-react/-/live-preview-react-3.74.0.tgz",
|
||||||
"integrity": "sha512-1JY/QzfIy6iOijpbdRdnV+TuK0B0vo8nTgH+WkfCWxayXf30FlykWW8sdBc44wn4CxmLry36cEeneqAbrasiWQ==",
|
"integrity": "sha512-/ItgTm+xlHT0tlv93Dmyb/NXB9N1rqTRzd4PfA45ZVN392xl6JtjfjKbafJ0inRBjK6eE8J73DVfmDvJMZV7NA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@payloadcms/live-preview": "3.79.0"
|
"@payloadcms/live-preview": "3.74.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.1 || ^19.1.2 || ^19.2.1",
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.1 || ^19.1.2 || ^19.2.1",
|
||||||
|
|
@ -14200,16 +14199,6 @@
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/qs-esm": {
|
|
||||||
"version": "7.0.3",
|
|
||||||
"license": "BSD-3-Clause",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/queue-microtask": {
|
"node_modules/queue-microtask": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import { Metadata } from 'next'
|
||||||
import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
|
import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
|
||||||
import { Section } from '@/components/Section/Section'
|
import { Section } from '@/components/Section/Section'
|
||||||
import { isAuthenticated } from '@/utils/auth'
|
import { isAuthenticated } from '@/utils/auth'
|
||||||
|
import { RefreshRouteOnSave } from '@/components/RefreshRouteOnSave/RefreshRouteOnSave'
|
||||||
|
import { draftMode } from 'next/headers'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
params: Promise<{ slug: string }>
|
params: Promise<{ slug: string }>
|
||||||
|
|
@ -24,19 +26,25 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||||
|
|
||||||
export default async function DynamicPage({ params }: Props) {
|
export default async function DynamicPage({ params }: Props) {
|
||||||
const slug = (await params).slug
|
const slug = (await params).slug
|
||||||
const page = await fetchPageBySlug(slug)
|
const { isEnabled: isDraft } = await draftMode()
|
||||||
|
const page = await fetchPageBySlug(slug, isDraft)
|
||||||
const authenticated = await isAuthenticated()
|
const authenticated = await isAuthenticated()
|
||||||
|
|
||||||
if (!page) {
|
if (!page) {
|
||||||
notFound()
|
notFound()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!authenticated && page._status !== "published") {
|
||||||
|
notFound();
|
||||||
|
}
|
||||||
|
|
||||||
const firstBlockType = page.content?.[0]?.blockType
|
const firstBlockType = page.content?.[0]?.blockType
|
||||||
const needsTopPadding =
|
const needsTopPadding =
|
||||||
firstBlockType === 'title' || firstBlockType === 'text'
|
firstBlockType === 'title' || firstBlockType === 'text'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{isDraft && <RefreshRouteOnSave />}
|
||||||
{needsTopPadding && <Section padding={'medium'} />}
|
{needsTopPadding && <Section padding={'medium'} />}
|
||||||
|
|
||||||
{page.content && page.content.length > 0 && (
|
{page.content && page.content.length > 0 && (
|
||||||
|
|
|
||||||
|
|
@ -7,25 +7,13 @@ import { notFound } from 'next/navigation'
|
||||||
import { readableDateTime } from '@/utils/readableDate'
|
import { readableDateTime } from '@/utils/readableDate'
|
||||||
import { HR } from '@/components/HorizontalRule/HorizontalRule'
|
import { HR } from '@/components/HorizontalRule/HorizontalRule'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import styles from "./styles.module.scss"
|
import styles from './styles.module.scss'
|
||||||
import { Blocks } from '@/compositions/Blocks/Blocks'
|
import { Blocks } from '@/compositions/Blocks/Blocks'
|
||||||
import { isAuthenticated } from '@/utils/auth'
|
import { isAuthenticated } from '@/utils/auth'
|
||||||
import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
|
import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
|
||||||
import { RefreshRouteOnSave } from '@/components/RefreshRouteOnSave/RefreshRouteOnSave'
|
import { RefreshRouteOnSave } from '@/components/RefreshRouteOnSave/RefreshRouteOnSave'
|
||||||
import { getPayload } from 'payload'
|
|
||||||
import config from '@/payload.config'
|
|
||||||
import { draftMode } from 'next/headers'
|
import { draftMode } from 'next/headers'
|
||||||
|
import { fetchBlog } from '@/fetch/blog'
|
||||||
async function fetchBlog(id: string, draft: boolean) {
|
|
||||||
const payload = await getPayload({ config })
|
|
||||||
const blog = await payload.findByID({
|
|
||||||
collection: 'blog',
|
|
||||||
id: id,
|
|
||||||
draft,
|
|
||||||
})
|
|
||||||
|
|
||||||
return blog
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function BlogPage({ params }: { params: Promise<{id: string}>}){
|
export default async function BlogPage({ params }: { params: Promise<{id: string}>}){
|
||||||
|
|
||||||
|
|
@ -39,6 +27,10 @@ export default async function BlogPage({ params }: { params: Promise<{id: string
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!authenticated && data._status !== "published") {
|
||||||
|
notFound();
|
||||||
|
}
|
||||||
|
|
||||||
// determine if some margin at the bottom should be added
|
// determine if some margin at the bottom should be added
|
||||||
const length = data.content.content.length;
|
const length = data.content.content.length;
|
||||||
const shouldAddMargin = data.content.content[length - 1].blockType === "text"
|
const shouldAddMargin = data.content.content[length - 1].blockType === "text"
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,21 @@ import { getPhoto, transformGallery } from '@/utils/dto/gallery'
|
||||||
import { fetchLastCalendar } from '@/fetch/calendar'
|
import { fetchLastCalendar } from '@/fetch/calendar'
|
||||||
import { isAuthenticated } from '@/utils/auth'
|
import { isAuthenticated } from '@/utils/auth'
|
||||||
import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
|
import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
|
||||||
|
import { RefreshRouteOnSave } from '@/components/RefreshRouteOnSave/RefreshRouteOnSave'
|
||||||
|
import { draftMode } from 'next/headers'
|
||||||
|
|
||||||
export default async function ParishPage ({ params }: { params: Promise<{slug: string}>}) {
|
export default async function ParishPage ({ params }: { params: Promise<{slug: string}>}) {
|
||||||
|
|
||||||
const slug = (await params).slug;
|
const slug = (await params).slug;
|
||||||
const parish = await fetchParish(slug);
|
const { isEnabled: isDraft } = await draftMode()
|
||||||
|
const parish = await fetchParish(slug, isDraft);
|
||||||
|
const authenticated = await isAuthenticated();
|
||||||
|
|
||||||
if(!parish || !parish.docs[0]) {
|
if(!parish) {
|
||||||
|
notFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!authenticated && parish._status !== "published") {
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,16 +37,16 @@ export default async function ParishPage ({ params }: { params: Promise<{slug: s
|
||||||
churches,
|
churches,
|
||||||
gallery,
|
gallery,
|
||||||
content
|
content
|
||||||
} = parish.docs[0]
|
} = parish
|
||||||
const events = await fetchEvents({ parishId: id })
|
const events = await fetchEvents({ parishId: id })
|
||||||
const churchIds = churches.map(c => typeof c === "string" ? c : c.id)
|
const churchIds = churches.map(c => typeof c === "string" ? c : c.id)
|
||||||
const worship = await fetchWorship({ locations: churchIds })
|
const worship = await fetchWorship({ locations: churchIds })
|
||||||
const announcement = await fetchLastAnnouncement(id);
|
const announcement = await fetchLastAnnouncement(id);
|
||||||
const calendar = await fetchLastCalendar(id);
|
const calendar = await fetchLastCalendar(id);
|
||||||
const authenticated = await isAuthenticated();
|
|
||||||
const image = getPhoto("tablet", photo)
|
const image = getPhoto("tablet", photo)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{isDraft && <RefreshRouteOnSave />}
|
||||||
<Parish
|
<Parish
|
||||||
title={name}
|
title={name}
|
||||||
slug={slug}
|
slug={slug}
|
||||||
|
|
|
||||||
|
|
@ -9,30 +9,37 @@ import { HR } from '@/components/HorizontalRule/HorizontalRule'
|
||||||
import { TextDiv } from '@/components/Text/TextDiv'
|
import { TextDiv } from '@/components/Text/TextDiv'
|
||||||
import { Col } from '@/components/Flex/Col'
|
import { Col } from '@/components/Flex/Col'
|
||||||
import { Row } from '@/components/Flex/Row'
|
import { Row } from '@/components/Flex/Row'
|
||||||
import { RawHTML } from '@/components/RawHTML/RawHTML'
|
|
||||||
import { Blocks } from '@/compositions/Blocks/Blocks'
|
import { Blocks } from '@/compositions/Blocks/Blocks'
|
||||||
import { getPhoto } from '@/utils/dto/gallery'
|
import { getPhoto } from '@/utils/dto/gallery'
|
||||||
import { isAuthenticated } from '@/utils/auth'
|
import { isAuthenticated } from '@/utils/auth'
|
||||||
import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
|
import { AdminMenu } from '@/components/AdminMenu/AdminMenu'
|
||||||
import { GroupEvents } from '@/compositions/GroupEvents/GroupEvents'
|
import { GroupEvents } from '@/compositions/GroupEvents/GroupEvents'
|
||||||
import { RichText } from '@payloadcms/richtext-lexical/react'
|
import { RichText } from '@payloadcms/richtext-lexical/react'
|
||||||
|
import { RefreshRouteOnSave } from '@/components/RefreshRouteOnSave/RefreshRouteOnSave'
|
||||||
|
import { draftMode } from 'next/headers'
|
||||||
|
|
||||||
export default async function GroupPage({ params }: { params: Promise<{slug: string}>}) {
|
export default async function GroupPage({ params }: { params: Promise<{slug: string}>}) {
|
||||||
|
|
||||||
const slug = (await params).slug
|
const slug = (await params).slug
|
||||||
const groups = await fetchGroup(slug)
|
const { isEnabled: isDraft } = await draftMode()
|
||||||
|
const group = await fetchGroup(slug, isDraft)
|
||||||
|
|
||||||
if(!groups || groups.docs.length === 0) {
|
if(!group) {
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
const {id, shortDescription, photo,name, content, text } = groups.docs[0]
|
|
||||||
const media = getPhoto("tablet", photo)
|
|
||||||
|
|
||||||
const authenticated = await isAuthenticated();
|
const authenticated = await isAuthenticated();
|
||||||
|
|
||||||
|
if(!authenticated && group._status !== "published") {
|
||||||
|
notFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
const {id, shortDescription, photo, name, content, text } = group
|
||||||
|
const media = getPhoto("tablet", photo)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{isDraft && <RefreshRouteOnSave />}
|
||||||
|
|
||||||
{ media &&
|
{ media &&
|
||||||
<ImageWithText
|
<ImageWithText
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,14 @@ import { EventPage } from '@/pageComponents/Event/Event'
|
||||||
import { getPhoto } from '@/utils/dto/gallery'
|
import { getPhoto } from '@/utils/dto/gallery'
|
||||||
import { isAuthenticated } from '@/utils/auth'
|
import { isAuthenticated } from '@/utils/auth'
|
||||||
import { fetchEventById } from '@/fetch/events'
|
import { fetchEventById } from '@/fetch/events'
|
||||||
|
import { RefreshRouteOnSave } from '@/components/RefreshRouteOnSave/RefreshRouteOnSave'
|
||||||
|
import { draftMode } from 'next/headers'
|
||||||
|
|
||||||
export default async function Page({ params }: { params: Promise<{id: string}>}) {
|
export default async function Page({ params }: { params: Promise<{id: string}>}) {
|
||||||
|
|
||||||
const id = (await params).id;
|
const id = (await params).id;
|
||||||
const event = await fetchEventById(id)
|
const { isEnabled: isDraft } = await draftMode()
|
||||||
|
const event = await fetchEventById(id, isDraft)
|
||||||
|
|
||||||
if (!event) {
|
if (!event) {
|
||||||
notFound()
|
notFound()
|
||||||
|
|
@ -15,10 +18,16 @@ export default async function Page({ params }: { params: Promise<{id: string}>})
|
||||||
|
|
||||||
const authenticated = await isAuthenticated();
|
const authenticated = await isAuthenticated();
|
||||||
|
|
||||||
|
if(!authenticated && event._status !== "published") {
|
||||||
|
notFound();
|
||||||
|
}
|
||||||
|
|
||||||
const group = Array.isArray(event.group) && event.group.length > 0 && typeof event.group[0] == "object" ? event.group[0].slug : undefined;
|
const group = Array.isArray(event.group) && event.group.length > 0 && typeof event.group[0] == "object" ? event.group[0].slug : undefined;
|
||||||
const photo = getPhoto("tablet", event.photo);
|
const photo = getPhoto("tablet", event.photo);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
{isDraft && <RefreshRouteOnSave />}
|
||||||
<EventPage
|
<EventPage
|
||||||
id={event.id}
|
id={event.id}
|
||||||
title={event.title}
|
title={event.title}
|
||||||
|
|
@ -36,5 +45,6 @@ export default async function Page({ params }: { params: Promise<{id: string}>})
|
||||||
photo={photo}
|
photo={photo}
|
||||||
isAuthenticated={authenticated}
|
isAuthenticated={authenticated}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { GalleryBlock } from '@/collections/blocks/Gallery'
|
||||||
import { DonationBlock } from '@/collections/blocks/Donation'
|
import { DonationBlock } from '@/collections/blocks/Donation'
|
||||||
import { ButtonBlock } from '@/collections/blocks/Button'
|
import { ButtonBlock } from '@/collections/blocks/Button'
|
||||||
import { YoutubePlayerBlock } from '@/collections/blocks/YoutubePlayer'
|
import { YoutubePlayerBlock } from '@/collections/blocks/YoutubePlayer'
|
||||||
|
import { isPublishedPublic } from '@/collections/access/public'
|
||||||
|
|
||||||
|
|
||||||
export const Blog: CollectionConfig = {
|
export const Blog: CollectionConfig = {
|
||||||
|
|
@ -122,10 +123,12 @@ export const Blog: CollectionConfig = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
versions: {
|
versions: {
|
||||||
drafts: true
|
drafts: {
|
||||||
|
validate: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
access: {
|
access: {
|
||||||
read: () => true,
|
read: isPublishedPublic(),
|
||||||
create: isAdminOrEmployee(),
|
create: isAdminOrEmployee(),
|
||||||
update: isAdminOrEmployee(),
|
update: isAdminOrEmployee(),
|
||||||
delete: isAdminOrEmployee(),
|
delete: isAdminOrEmployee(),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { CollectionConfig } from 'payload'
|
import { CollectionConfig } from 'payload'
|
||||||
import { Group, User } from '@/payload-types'
|
import { Group, User } from '@/payload-types'
|
||||||
import { fetchEventById } from '@/fetch/events'
|
import { fetchEventById } from '@/fetch/events'
|
||||||
|
import { isPublishedPublic } from '@/collections/access/public'
|
||||||
|
|
||||||
export const Events: CollectionConfig = {
|
export const Events: CollectionConfig = {
|
||||||
slug: 'event',
|
slug: 'event',
|
||||||
|
|
@ -182,9 +183,17 @@ export const Events: CollectionConfig = {
|
||||||
],
|
],
|
||||||
admin: {
|
admin: {
|
||||||
useAsTitle: 'title',
|
useAsTitle: 'title',
|
||||||
|
livePreview: {
|
||||||
|
url: ({ data }) => `/api/draft?url=/veranstaltungen/${data.id}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
versions: {
|
||||||
|
drafts: {
|
||||||
|
validate: true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
access: {
|
access: {
|
||||||
read: () => true,
|
read: isPublishedPublic(),
|
||||||
// admins and employees can delete, others only if they are member of the group
|
// admins and employees can delete, others only if they are member of the group
|
||||||
delete: async ({ req: { user }, id }) => {
|
delete: async ({ req: { user }, id }) => {
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { DocumentBlock } from '@/collections/blocks/Document'
|
||||||
import { DonationBlock } from '@/collections/blocks/Donation'
|
import { DonationBlock } from '@/collections/blocks/Donation'
|
||||||
import { ButtonBlock } from '@/collections/blocks/Button'
|
import { ButtonBlock } from '@/collections/blocks/Button'
|
||||||
import { YoutubePlayerBlock } from '@/collections/blocks/YoutubePlayer'
|
import { YoutubePlayerBlock } from '@/collections/blocks/YoutubePlayer'
|
||||||
|
import { isPublishedPublic } from '@/collections/access/public'
|
||||||
|
|
||||||
export const Groups: CollectionConfig = {
|
export const Groups: CollectionConfig = {
|
||||||
slug: 'group',
|
slug: 'group',
|
||||||
|
|
@ -92,9 +93,17 @@ export const Groups: CollectionConfig = {
|
||||||
},
|
},
|
||||||
admin: {
|
admin: {
|
||||||
useAsTitle: 'name',
|
useAsTitle: 'name',
|
||||||
|
livePreview: {
|
||||||
|
url: ({ data }) => `/api/draft?url=/gruppe/${data.slug}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
versions: {
|
||||||
|
drafts: {
|
||||||
|
validate: true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
access: {
|
access: {
|
||||||
read: () => true,
|
read: isPublishedPublic(),
|
||||||
create: isAdminOrEmployee(),
|
create: isAdminOrEmployee(),
|
||||||
update: ({ req, id }) => {
|
update: ({ req, id }) => {
|
||||||
if (!req.user) {
|
if (!req.user) {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import { MassTimesBlock } from '@/collections/blocks/MassTimes'
|
||||||
import { CollapsibleImageWithTextBlock } from '@/collections/blocks/CollapsibleImageWithText'
|
import { CollapsibleImageWithTextBlock } from '@/collections/blocks/CollapsibleImageWithText'
|
||||||
import { EventsBlock } from '@/collections/blocks/Events'
|
import { EventsBlock } from '@/collections/blocks/Events'
|
||||||
import { PublicationAndNewsletterBlock } from '@/collections/blocks/PublicationAndNewsletter'
|
import { PublicationAndNewsletterBlock } from '@/collections/blocks/PublicationAndNewsletter'
|
||||||
|
import { isPublishedPublic } from '@/collections/access/public'
|
||||||
|
|
||||||
export const Pages: CollectionConfig = {
|
export const Pages: CollectionConfig = {
|
||||||
slug: 'pages',
|
slug: 'pages',
|
||||||
|
|
@ -94,18 +95,24 @@ export const Pages: CollectionConfig = {
|
||||||
HorizontalRuleBlock,
|
HorizontalRuleBlock,
|
||||||
BlogSliderBlock,
|
BlogSliderBlock,
|
||||||
MassTimesBlock,
|
MassTimesBlock,
|
||||||
CollapsibleImageWithTextBlock,
|
|
||||||
EventsBlock,
|
EventsBlock,
|
||||||
PublicationAndNewsletterBlock,
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
admin: {
|
admin: {
|
||||||
useAsTitle: 'title',
|
useAsTitle: 'title',
|
||||||
hidden: hide,
|
hidden: hide,
|
||||||
|
livePreview: {
|
||||||
|
url: ({ data }) => `/api/draft?url=/${data.slug}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
versions: {
|
||||||
|
drafts: {
|
||||||
|
validate: true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
access: {
|
access: {
|
||||||
read: () => true,
|
read: isPublishedPublic(),
|
||||||
create: isAdminOrEmployee(),
|
create: isAdminOrEmployee(),
|
||||||
update: isAdminOrEmployee(),
|
update: isAdminOrEmployee(),
|
||||||
delete: isAdminOrEmployee(),
|
delete: isAdminOrEmployee(),
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { DocumentBlock } from '@/collections/blocks/Document'
|
||||||
import { DonationBlock } from '@/collections/blocks/Donation'
|
import { DonationBlock } from '@/collections/blocks/Donation'
|
||||||
import { YoutubePlayerBlock } from '@/collections/blocks/YoutubePlayer'
|
import { YoutubePlayerBlock } from '@/collections/blocks/YoutubePlayer'
|
||||||
import { DonationAppeal } from '@/collections/blocks/DonationAppeal'
|
import { DonationAppeal } from '@/collections/blocks/DonationAppeal'
|
||||||
|
import { isPublishedPublic } from '@/collections/access/public'
|
||||||
|
|
||||||
export const Parish: CollectionConfig = {
|
export const Parish: CollectionConfig = {
|
||||||
slug: 'parish',
|
slug: 'parish',
|
||||||
|
|
@ -163,10 +164,18 @@ export const Parish: CollectionConfig = {
|
||||||
],
|
],
|
||||||
admin: {
|
admin: {
|
||||||
useAsTitle: 'name',
|
useAsTitle: 'name',
|
||||||
hidden: hide
|
hidden: hide,
|
||||||
|
livePreview: {
|
||||||
|
url: ({ data }) => `/api/draft?url=/gemeinde/${data.slug}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
versions: {
|
||||||
|
drafts: {
|
||||||
|
validate: true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
access: {
|
access: {
|
||||||
read: () => true,
|
read: isPublishedPublic(),
|
||||||
create: isAdmin(),
|
create: isAdmin(),
|
||||||
update: isAdminOrEmployee(),
|
update: isAdminOrEmployee(),
|
||||||
delete: isAdmin(),
|
delete: isAdmin(),
|
||||||
|
|
|
||||||
17
src/collections/access/public.ts
Normal file
17
src/collections/access/public.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
import type { Access } from 'payload'
|
||||||
|
|
||||||
|
export const isPublishedPublic = (): Access =>
|
||||||
|
({ req: { user } }) => {
|
||||||
|
// If there is a user logged in,
|
||||||
|
// let them retrieve all documents
|
||||||
|
if (user) return true
|
||||||
|
|
||||||
|
// If there is no user,
|
||||||
|
// restrict the documents that are returned
|
||||||
|
// to only those where `_status` is equal to `published`
|
||||||
|
return {
|
||||||
|
_status: {
|
||||||
|
equals: 'published',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -193,29 +193,29 @@ export function Blocks({ content }: BlocksProps) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.blockType === 'collapsibleImageWithText') {
|
// if (item.blockType === 'collapsibleImageWithText') {
|
||||||
const imageUrl = typeof item.image === 'object' && item.image?.url
|
// const imageUrl = typeof item.image === 'object' && item.image?.url
|
||||||
? item.image.url
|
// ? item.image.url
|
||||||
: ''
|
// : ''
|
||||||
const bg = item.backgroundColor === 'none'
|
// const bg = item.backgroundColor === 'none'
|
||||||
? undefined
|
// ? undefined
|
||||||
: item.backgroundColor as 'soft' | 'off-white' | undefined
|
// : item.backgroundColor as 'soft' | 'off-white' | undefined
|
||||||
return (
|
// return (
|
||||||
<CollapsibleImageWithText
|
// <CollapsibleImageWithText
|
||||||
key={item.id}
|
// key={item.id}
|
||||||
title={item.title}
|
// title={item.title}
|
||||||
text={item.text}
|
// text={item.text}
|
||||||
image={imageUrl}
|
// image={imageUrl}
|
||||||
backgroundColor={bg}
|
// backgroundColor={bg}
|
||||||
schema={item.schema as 'base' | 'contrast' | undefined}
|
// schema={item.schema as 'base' | 'contrast' | undefined}
|
||||||
content={
|
// content={
|
||||||
item.content
|
// item.content
|
||||||
? <HTMLText width={'1/2'} data={item.content} />
|
// ? <HTMLText width={'1/2'} data={item.content} />
|
||||||
: <></>
|
// : <></>
|
||||||
}
|
// }
|
||||||
/>
|
// />
|
||||||
)
|
// )
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (item.blockType === 'events') {
|
if (item.blockType === 'events') {
|
||||||
return (
|
return (
|
||||||
|
|
@ -227,9 +227,9 @@ export function Blocks({ content }: BlocksProps) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.blockType === 'publicationAndNewsletter') {
|
// if (item.blockType === 'publicationAndNewsletter') {
|
||||||
return <PublicationAndNewsletter key={item.id} />
|
// return <PublicationAndNewsletter key={item.id} />
|
||||||
}
|
// }
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,11 @@ export const fetchBlogPosts = async (displayOnFrontpage: boolean) => {
|
||||||
|
|
||||||
const query: any = {
|
const query: any = {
|
||||||
and: [
|
and: [
|
||||||
|
{
|
||||||
|
'_status': {
|
||||||
|
equals: 'published',
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
or: [
|
or: [
|
||||||
{
|
{
|
||||||
|
|
@ -65,3 +70,12 @@ export const fetchBlogPosts = async (displayOnFrontpage: boolean) => {
|
||||||
limit: 18,
|
limit: 18,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function fetchBlog(id: string, draft: boolean) {
|
||||||
|
const payload = await getPayload({ config })
|
||||||
|
return await payload.findByID({
|
||||||
|
collection: 'blog',
|
||||||
|
id: id,
|
||||||
|
draft,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -28,6 +28,11 @@ export async function fetchEvents(
|
||||||
|
|
||||||
const query: any = {
|
const query: any = {
|
||||||
and: [
|
and: [
|
||||||
|
{
|
||||||
|
'_status': {
|
||||||
|
equals: 'published',
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
date: {
|
date: {
|
||||||
greater_than_equal: fromDate.toISOString(),
|
greater_than_equal: fromDate.toISOString(),
|
||||||
|
|
@ -82,10 +87,11 @@ export async function fetchEvents(
|
||||||
*/
|
*/
|
||||||
export async function fetchEventById(
|
export async function fetchEventById(
|
||||||
id: string,
|
id: string,
|
||||||
|
draft: boolean = false,
|
||||||
): Promise<Event | undefined> {
|
): Promise<Event | undefined> {
|
||||||
try {
|
try {
|
||||||
const payload = await getPayload({ config })
|
const payload = await getPayload({ config })
|
||||||
return await payload.findByID({ collection: 'event', id })
|
return await payload.findByID({ collection: 'event', id, draft })
|
||||||
} catch {
|
} catch {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
import { getPayload } from 'payload'
|
import { getPayload } from 'payload'
|
||||||
import config from '@/payload.config'
|
import config from '@/payload.config'
|
||||||
|
|
||||||
export async function fetchGroup(slug: string) {
|
export async function fetchGroup(slug: string, draft: boolean = false) {
|
||||||
const payload = await getPayload({ config })
|
const payload = await getPayload({ config })
|
||||||
return payload.find({
|
const result = await payload.find({
|
||||||
collection: 'group',
|
collection: 'group',
|
||||||
where: {
|
where: {
|
||||||
slug: {
|
slug: {
|
||||||
equals: slug,
|
equals: slug,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
draft,
|
||||||
})
|
})
|
||||||
|
return result.docs[0] ?? null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,22 +5,28 @@ import { Page } from '@/payload-types'
|
||||||
|
|
||||||
export async function fetchPageBySlug(
|
export async function fetchPageBySlug(
|
||||||
slug: string,
|
slug: string,
|
||||||
|
draft: boolean = false,
|
||||||
): Promise<Page | undefined> {
|
): Promise<Page | undefined> {
|
||||||
return unstable_cache(
|
const fetchPage = async () => {
|
||||||
async () => {
|
const payload = await getPayload({ config })
|
||||||
const payload = await getPayload({ config })
|
const data = await payload.find({
|
||||||
const data = await payload.find({
|
collection: 'pages',
|
||||||
collection: 'pages',
|
where: {
|
||||||
where: {
|
slug: {
|
||||||
slug: {
|
equals: slug,
|
||||||
equals: slug,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
limit: 1,
|
},
|
||||||
})
|
limit: 1,
|
||||||
return data.docs?.[0] ?? undefined
|
draft,
|
||||||
},
|
})
|
||||||
['pages', slug],
|
return data.docs?.[0] ?? undefined
|
||||||
{ tags: ['pages', `pages-${slug}`] },
|
}
|
||||||
)()
|
|
||||||
|
if (draft) {
|
||||||
|
return fetchPage()
|
||||||
|
}
|
||||||
|
|
||||||
|
return unstable_cache(fetchPage, ['pages', slug], {
|
||||||
|
tags: ['pages', `pages-${slug}`],
|
||||||
|
})()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
import { getPayload } from 'payload'
|
import { getPayload } from 'payload'
|
||||||
import config from '@/payload.config'
|
import config from '@/payload.config'
|
||||||
|
|
||||||
export async function fetchParish(slug: string) {
|
export async function fetchParish(slug: string, draft: boolean = false) {
|
||||||
const payload = await getPayload({ config })
|
const payload = await getPayload({ config })
|
||||||
return payload.find({
|
const result = await payload.find({
|
||||||
collection: 'parish',
|
collection: 'parish',
|
||||||
where: {
|
where: {
|
||||||
slug: {
|
slug: {
|
||||||
equals: slug,
|
equals: slug,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
draft,
|
||||||
})
|
})
|
||||||
|
return result.docs[0] ?? null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11879
src/migrations/20260311_105947_drop_features.json
Normal file
11879
src/migrations/20260311_105947_drop_features.json
Normal file
File diff suppressed because it is too large
Load diff
59
src/migrations/20260311_105947_drop_features.ts
Normal file
59
src/migrations/20260311_105947_drop_features.ts
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
|
||||||
|
|
||||||
|
export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
|
||||||
|
await db.execute(sql`
|
||||||
|
ALTER TABLE "pages_blocks_collapsible_image_with_text" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "pages_blocks_publication_and_newsletter" DISABLE ROW LEVEL SECURITY;
|
||||||
|
DROP TABLE "pages_blocks_collapsible_image_with_text" CASCADE;
|
||||||
|
DROP TABLE "pages_blocks_publication_and_newsletter" CASCADE;
|
||||||
|
DROP INDEX "_blog_v_autosave_idx";
|
||||||
|
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2026-03-15T10:59:47.266Z';
|
||||||
|
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2026-03-15T10:59:47.547Z';
|
||||||
|
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2026-04-10T09:59:47.604Z';
|
||||||
|
ALTER TABLE "_blog_v" DROP COLUMN "autosave";
|
||||||
|
DROP TYPE "public"."enum_pages_blocks_collapsible_image_with_text_background_color";
|
||||||
|
DROP TYPE "public"."enum_pages_blocks_collapsible_image_with_text_schema";`)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
|
||||||
|
await db.execute(sql`
|
||||||
|
CREATE TYPE "public"."enum_pages_blocks_collapsible_image_with_text_background_color" AS ENUM('none', 'soft', 'off-white');
|
||||||
|
CREATE TYPE "public"."enum_pages_blocks_collapsible_image_with_text_schema" AS ENUM('base', 'contrast');
|
||||||
|
CREATE TABLE "pages_blocks_collapsible_image_with_text" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" varchar PRIMARY KEY NOT NULL,
|
||||||
|
"title" varchar NOT NULL,
|
||||||
|
"text" varchar NOT NULL,
|
||||||
|
"image_id" uuid NOT NULL,
|
||||||
|
"content" jsonb NOT NULL,
|
||||||
|
"background_color" "enum_pages_blocks_collapsible_image_with_text_background_color" DEFAULT 'none',
|
||||||
|
"schema" "enum_pages_blocks_collapsible_image_with_text_schema" DEFAULT 'base',
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "pages_blocks_publication_and_newsletter" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" varchar PRIMARY KEY NOT NULL,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2026-03-15T14:38:00.254Z';
|
||||||
|
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2026-03-15T14:38:00.534Z';
|
||||||
|
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2026-04-09T13:38:00.592Z';
|
||||||
|
ALTER TABLE "_blog_v" ADD COLUMN "autosave" boolean;
|
||||||
|
ALTER TABLE "pages_blocks_collapsible_image_with_text" ADD CONSTRAINT "pages_blocks_collapsible_image_with_text_image_id_media_id_fk" FOREIGN KEY ("image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "pages_blocks_collapsible_image_with_text" ADD CONSTRAINT "pages_blocks_collapsible_image_with_text_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "pages_blocks_publication_and_newsletter" ADD CONSTRAINT "pages_blocks_publication_and_newsletter_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
CREATE INDEX "pages_blocks_collapsible_image_with_text_order_idx" ON "pages_blocks_collapsible_image_with_text" USING btree ("_order");
|
||||||
|
CREATE INDEX "pages_blocks_collapsible_image_with_text_parent_id_idx" ON "pages_blocks_collapsible_image_with_text" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "pages_blocks_collapsible_image_with_text_path_idx" ON "pages_blocks_collapsible_image_with_text" USING btree ("_path");
|
||||||
|
CREATE INDEX "pages_blocks_collapsible_image_with_text_image_idx" ON "pages_blocks_collapsible_image_with_text" USING btree ("image_id");
|
||||||
|
CREATE INDEX "pages_blocks_publication_and_newsletter_order_idx" ON "pages_blocks_publication_and_newsletter" USING btree ("_order");
|
||||||
|
CREATE INDEX "pages_blocks_publication_and_newsletter_parent_id_idx" ON "pages_blocks_publication_and_newsletter" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "pages_blocks_publication_and_newsletter_path_idx" ON "pages_blocks_publication_and_newsletter" USING btree ("_path");
|
||||||
|
CREATE INDEX "_blog_v_autosave_idx" ON "_blog_v" USING btree ("autosave");`)
|
||||||
|
}
|
||||||
17509
src/migrations/20260311_110236_live_preview.json
Normal file
17509
src/migrations/20260311_110236_live_preview.json
Normal file
File diff suppressed because it is too large
Load diff
901
src/migrations/20260311_110236_live_preview.ts
Normal file
901
src/migrations/20260311_110236_live_preview.ts
Normal file
|
|
@ -0,0 +1,901 @@
|
||||||
|
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
|
||||||
|
|
||||||
|
export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
|
||||||
|
await db.execute(sql`
|
||||||
|
CREATE TYPE "public"."enum_parish_status" AS ENUM('draft', 'published');
|
||||||
|
CREATE TYPE "public"."enum__parish_v_blocks_text_width" AS ENUM('1/2', '3/4');
|
||||||
|
CREATE TYPE "public"."enum__parish_v_version_status" AS ENUM('draft', 'published');
|
||||||
|
CREATE TYPE "public"."enum_event_status" AS ENUM('draft', 'published');
|
||||||
|
CREATE TYPE "public"."enum__event_v_version_status" AS ENUM('draft', 'published');
|
||||||
|
CREATE TYPE "public"."enum_group_status" AS ENUM('draft', 'published');
|
||||||
|
CREATE TYPE "public"."enum__group_v_blocks_text_width" AS ENUM('1/2', '3/4');
|
||||||
|
CREATE TYPE "public"."enum__group_v_version_status" AS ENUM('draft', 'published');
|
||||||
|
CREATE TYPE "public"."enum_pages_status" AS ENUM('draft', 'published');
|
||||||
|
CREATE TYPE "public"."enum__pages_v_blocks_text_width" AS ENUM('1/2', '3/4');
|
||||||
|
CREATE TYPE "public"."enum__pages_v_blocks_title_size" AS ENUM('xl', 'lg', 'md', 'sm');
|
||||||
|
CREATE TYPE "public"."enum__pages_v_blocks_title_align" AS ENUM('left', 'center');
|
||||||
|
CREATE TYPE "public"."enum__pages_v_blocks_section_background_color" AS ENUM('none', 'soft', 'off-white');
|
||||||
|
CREATE TYPE "public"."enum__pages_v_blocks_section_padding" AS ENUM('small', 'medium', 'large');
|
||||||
|
CREATE TYPE "public"."enum__pages_v_blocks_banner_background_position" AS ENUM('center center', 'top center', 'bottom center', 'center left', 'center right', 'top left', 'top right', 'bottom left', 'bottom right');
|
||||||
|
CREATE TYPE "public"."enum__pages_v_blocks_banner_background_size" AS ENUM('cover', 'contain', 'auto');
|
||||||
|
CREATE TYPE "public"."enum__pages_v_blocks_horizontal_rule_color" AS ENUM('base', 'shade1', 'shade2', 'shade3', 'contrast', 'contrastShade1');
|
||||||
|
CREATE TYPE "public"."enum__pages_v_version_status" AS ENUM('draft', 'published');
|
||||||
|
CREATE TABLE "_parish_v_version_contact_persons" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"title" varchar,
|
||||||
|
"description" varchar,
|
||||||
|
"_uuid" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_parish_v_blocks_text" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"content" jsonb,
|
||||||
|
"width" "enum__parish_v_blocks_text_width" DEFAULT '1/2',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_parish_v_blocks_document" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"file_id" uuid,
|
||||||
|
"button" varchar DEFAULT 'Download Flyer',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_parish_v_blocks_donation" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_parish_v_blocks_youtube" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"youtube_id" varchar,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_parish_v_blocks_donation_appeal" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_parish_v_version_gallery" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"photo_id" uuid,
|
||||||
|
"_uuid" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_parish_v" (
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"parent_id" uuid,
|
||||||
|
"version_name" varchar,
|
||||||
|
"version_slug" varchar,
|
||||||
|
"version_description" varchar,
|
||||||
|
"version_history" varchar,
|
||||||
|
"version_contact" varchar,
|
||||||
|
"version_photo_id" uuid,
|
||||||
|
"version_updated_at" timestamp(3) with time zone,
|
||||||
|
"version_created_at" timestamp(3) with time zone,
|
||||||
|
"version__status" "enum__parish_v_version_status" DEFAULT 'draft',
|
||||||
|
"created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
|
||||||
|
"updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
|
||||||
|
"latest" boolean
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_parish_v_rels" (
|
||||||
|
"id" serial PRIMARY KEY NOT NULL,
|
||||||
|
"order" integer,
|
||||||
|
"parent_id" uuid NOT NULL,
|
||||||
|
"path" varchar NOT NULL,
|
||||||
|
"church_id" uuid
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_event_v" (
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"parent_id" uuid,
|
||||||
|
"version_title" varchar,
|
||||||
|
"version_date" timestamp(3) with time zone,
|
||||||
|
"version_location_id" uuid,
|
||||||
|
"version_contact_id" uuid,
|
||||||
|
"version_short_description" varchar,
|
||||||
|
"version_description" varchar,
|
||||||
|
"version_rsvp_link" varchar,
|
||||||
|
"version_photo_id" uuid,
|
||||||
|
"version_flyer_id" uuid,
|
||||||
|
"version_cancelled" boolean DEFAULT false,
|
||||||
|
"version_is_recurring" boolean DEFAULT false,
|
||||||
|
"version_updated_at" timestamp(3) with time zone,
|
||||||
|
"version_created_at" timestamp(3) with time zone,
|
||||||
|
"version__status" "enum__event_v_version_status" DEFAULT 'draft',
|
||||||
|
"created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
|
||||||
|
"updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
|
||||||
|
"latest" boolean
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_event_v_rels" (
|
||||||
|
"id" serial PRIMARY KEY NOT NULL,
|
||||||
|
"order" integer,
|
||||||
|
"parent_id" uuid NOT NULL,
|
||||||
|
"path" varchar NOT NULL,
|
||||||
|
"parish_id" uuid,
|
||||||
|
"group_id" uuid
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_group_v_blocks_text" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"content" jsonb,
|
||||||
|
"width" "enum__group_v_blocks_text_width" DEFAULT '1/2',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_group_v_blocks_gallery_items" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"photo_id" uuid,
|
||||||
|
"_uuid" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_group_v_blocks_gallery" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_group_v_blocks_document" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"file_id" uuid,
|
||||||
|
"button" varchar DEFAULT 'Download Flyer',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_group_v_blocks_donation" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_group_v_blocks_youtube" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"youtube_id" varchar,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_group_v_blocks_contactform" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"title" varchar DEFAULT 'Ich bin dabei!',
|
||||||
|
"description" varchar DEFAULT 'Um dich anzumelden oder uns zu unterstützen, fülle bitte das Kontaktformular aus. Wir freuen uns sehr, dass du Teil unserer Gemeinschaft bist und mit deinem Engagement dazu beiträgst, unsere Ziele zu erreichen. Solltest du Fragen haben oder weitere Informationen benötigen, zögere nicht, uns zu kontaktieren – wir sind gerne für dich da!',
|
||||||
|
"email" varchar DEFAULT 'kontakt@mutter-teresa-chemnitz.de',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_group_v_blocks_button" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"text" varchar,
|
||||||
|
"url" varchar,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_group_v" (
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"parent_id" uuid,
|
||||||
|
"version_photo_id" uuid,
|
||||||
|
"version_name" varchar,
|
||||||
|
"version_slug" varchar,
|
||||||
|
"version_short_description" varchar,
|
||||||
|
"version_text" jsonb,
|
||||||
|
"version_updated_at" timestamp(3) with time zone,
|
||||||
|
"version_created_at" timestamp(3) with time zone,
|
||||||
|
"version__status" "enum__group_v_version_status" DEFAULT 'draft',
|
||||||
|
"created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
|
||||||
|
"updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
|
||||||
|
"latest" boolean
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_page_header" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"title" varchar,
|
||||||
|
"description" varchar,
|
||||||
|
"image_id" uuid,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_text" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"content" jsonb,
|
||||||
|
"width" "enum__pages_v_blocks_text_width" DEFAULT '1/2',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_title" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"title" varchar,
|
||||||
|
"subtitle" varchar,
|
||||||
|
"size" "enum__pages_v_blocks_title_size" DEFAULT 'lg',
|
||||||
|
"align" "enum__pages_v_blocks_title_align" DEFAULT 'left',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_section" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"background_color" "enum__pages_v_blocks_section_background_color" DEFAULT 'none',
|
||||||
|
"padding" "enum__pages_v_blocks_section_padding" DEFAULT 'large',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_gallery_items" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"photo_id" uuid,
|
||||||
|
"_uuid" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_gallery" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_document" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"file_id" uuid,
|
||||||
|
"button" varchar DEFAULT 'Download Flyer',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_youtube" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"youtube_id" varchar,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_button" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"text" varchar,
|
||||||
|
"url" varchar,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_contactform" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"title" varchar DEFAULT 'Ich bin dabei!',
|
||||||
|
"description" varchar DEFAULT 'Um dich anzumelden oder uns zu unterstützen, fülle bitte das Kontaktformular aus. Wir freuen uns sehr, dass du Teil unserer Gemeinschaft bist und mit deinem Engagement dazu beiträgst, unsere Ziele zu erreichen. Solltest du Fragen haben oder weitere Informationen benötigen, zögere nicht, uns zu kontaktieren – wir sind gerne für dich da!',
|
||||||
|
"email" varchar DEFAULT 'kontakt@mutter-teresa-chemnitz.de',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_donation" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_banner" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"text_line1" varchar,
|
||||||
|
"text_line2" varchar,
|
||||||
|
"text_line3" varchar,
|
||||||
|
"background_color" varchar,
|
||||||
|
"background_image_id" uuid,
|
||||||
|
"background_position" "enum__pages_v_blocks_banner_background_position" DEFAULT 'center center',
|
||||||
|
"background_size" "enum__pages_v_blocks_banner_background_size" DEFAULT 'cover',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_main_text" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"text" varchar DEFAULT 'Jesus sagte zu ihm: Ich bin der Weg und die Wahrheit und das Leben; niemand kommt zum Vater außer durch mich. Wenn ihr mich erkannt habt, werdet ihr auch meinen Vater erkennen.',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_horizontal_rule" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"color" "enum__pages_v_blocks_horizontal_rule_color" DEFAULT 'base',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_blog_slider" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"title" varchar DEFAULT 'Aktuelles',
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_mass_times" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"title" varchar DEFAULT 'Nächste Gottesdienste',
|
||||||
|
"subtitle" varchar,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v_blocks_events" (
|
||||||
|
"_order" integer NOT NULL,
|
||||||
|
"_parent_id" uuid NOT NULL,
|
||||||
|
"_path" text NOT NULL,
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"title" varchar DEFAULT 'Veranstaltungen',
|
||||||
|
"items_per_page" numeric DEFAULT 6,
|
||||||
|
"_uuid" varchar,
|
||||||
|
"block_name" varchar
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE "_pages_v" (
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"parent_id" uuid,
|
||||||
|
"version_title" varchar,
|
||||||
|
"version_description" varchar,
|
||||||
|
"version_slug" varchar,
|
||||||
|
"version_updated_at" timestamp(3) with time zone,
|
||||||
|
"version_created_at" timestamp(3) with time zone,
|
||||||
|
"version__status" "enum__pages_v_version_status" DEFAULT 'draft',
|
||||||
|
"created_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
|
||||||
|
"updated_at" timestamp(3) with time zone DEFAULT now() NOT NULL,
|
||||||
|
"latest" boolean
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE "parish_contact_persons" ALTER COLUMN "title" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish_contact_persons" ALTER COLUMN "description" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_text" ALTER COLUMN "content" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_text" ALTER COLUMN "width" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_document" ALTER COLUMN "file_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_document" ALTER COLUMN "button" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_youtube" ALTER COLUMN "youtube_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish_gallery" ALTER COLUMN "photo_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "name" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "slug" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "description" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "history" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "contact" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "photo_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2026-03-15T11:02:35.690Z';
|
||||||
|
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2026-03-15T11:02:35.969Z';
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "title" DROP NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "date" DROP NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "location_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "short_description" DROP NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "description" DROP NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "cancelled" DROP NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "is_recurring" DROP NOT NULL;
|
||||||
|
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2026-04-10T10:02:36.027Z';
|
||||||
|
ALTER TABLE "group_blocks_text" ALTER COLUMN "content" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_text" ALTER COLUMN "width" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_gallery_items" ALTER COLUMN "photo_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_document" ALTER COLUMN "file_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_document" ALTER COLUMN "button" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_youtube" ALTER COLUMN "youtube_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_contactform" ALTER COLUMN "title" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_contactform" ALTER COLUMN "description" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_contactform" ALTER COLUMN "email" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_button" ALTER COLUMN "text" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_button" ALTER COLUMN "url" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group" ALTER COLUMN "name" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group" ALTER COLUMN "slug" DROP NOT NULL;
|
||||||
|
ALTER TABLE "group" ALTER COLUMN "short_description" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_page_header" ALTER COLUMN "title" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_page_header" ALTER COLUMN "description" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_text" ALTER COLUMN "content" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_text" ALTER COLUMN "width" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_title" ALTER COLUMN "title" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_gallery_items" ALTER COLUMN "photo_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_document" ALTER COLUMN "file_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_document" ALTER COLUMN "button" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_youtube" ALTER COLUMN "youtube_id" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_button" ALTER COLUMN "text" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_button" ALTER COLUMN "url" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_contactform" ALTER COLUMN "title" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_contactform" ALTER COLUMN "description" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_contactform" ALTER COLUMN "email" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_main_text" ALTER COLUMN "text" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_horizontal_rule" ALTER COLUMN "color" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages" ALTER COLUMN "title" DROP NOT NULL;
|
||||||
|
ALTER TABLE "pages" ALTER COLUMN "slug" DROP NOT NULL;
|
||||||
|
ALTER TABLE "parish" ADD COLUMN "_status" "enum_parish_status" DEFAULT 'draft';
|
||||||
|
ALTER TABLE "event" ADD COLUMN "_status" "enum_event_status" DEFAULT 'draft';
|
||||||
|
ALTER TABLE "group" ADD COLUMN "_status" "enum_group_status" DEFAULT 'draft';
|
||||||
|
ALTER TABLE "pages" ADD COLUMN "_status" "enum_pages_status" DEFAULT 'draft';
|
||||||
|
ALTER TABLE "_parish_v_version_contact_persons" ADD CONSTRAINT "_parish_v_version_contact_persons_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_parish_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_blocks_text" ADD CONSTRAINT "_parish_v_blocks_text_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_parish_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_blocks_document" ADD CONSTRAINT "_parish_v_blocks_document_file_id_documents_id_fk" FOREIGN KEY ("file_id") REFERENCES "public"."documents"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_blocks_document" ADD CONSTRAINT "_parish_v_blocks_document_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_parish_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_blocks_donation" ADD CONSTRAINT "_parish_v_blocks_donation_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_parish_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_blocks_youtube" ADD CONSTRAINT "_parish_v_blocks_youtube_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_parish_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_blocks_donation_appeal" ADD CONSTRAINT "_parish_v_blocks_donation_appeal_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_parish_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_version_gallery" ADD CONSTRAINT "_parish_v_version_gallery_photo_id_media_id_fk" FOREIGN KEY ("photo_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_version_gallery" ADD CONSTRAINT "_parish_v_version_gallery_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_parish_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v" ADD CONSTRAINT "_parish_v_parent_id_parish_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."parish"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v" ADD CONSTRAINT "_parish_v_version_photo_id_media_id_fk" FOREIGN KEY ("version_photo_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_rels" ADD CONSTRAINT "_parish_v_rels_parent_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."_parish_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_parish_v_rels" ADD CONSTRAINT "_parish_v_rels_church_fk" FOREIGN KEY ("church_id") REFERENCES "public"."church"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_event_v" ADD CONSTRAINT "_event_v_parent_id_event_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."event"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_event_v" ADD CONSTRAINT "_event_v_version_location_id_locations_id_fk" FOREIGN KEY ("version_location_id") REFERENCES "public"."locations"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_event_v" ADD CONSTRAINT "_event_v_version_contact_id_contact_person_id_fk" FOREIGN KEY ("version_contact_id") REFERENCES "public"."contact_person"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_event_v" ADD CONSTRAINT "_event_v_version_photo_id_media_id_fk" FOREIGN KEY ("version_photo_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_event_v" ADD CONSTRAINT "_event_v_version_flyer_id_documents_id_fk" FOREIGN KEY ("version_flyer_id") REFERENCES "public"."documents"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_event_v_rels" ADD CONSTRAINT "_event_v_rels_parent_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."_event_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_event_v_rels" ADD CONSTRAINT "_event_v_rels_parish_fk" FOREIGN KEY ("parish_id") REFERENCES "public"."parish"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_event_v_rels" ADD CONSTRAINT "_event_v_rels_group_fk" FOREIGN KEY ("group_id") REFERENCES "public"."group"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_text" ADD CONSTRAINT "_group_v_blocks_text_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_group_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_gallery_items" ADD CONSTRAINT "_group_v_blocks_gallery_items_photo_id_media_id_fk" FOREIGN KEY ("photo_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_gallery_items" ADD CONSTRAINT "_group_v_blocks_gallery_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_group_v_blocks_gallery"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_gallery" ADD CONSTRAINT "_group_v_blocks_gallery_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_group_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_document" ADD CONSTRAINT "_group_v_blocks_document_file_id_documents_id_fk" FOREIGN KEY ("file_id") REFERENCES "public"."documents"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_document" ADD CONSTRAINT "_group_v_blocks_document_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_group_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_donation" ADD CONSTRAINT "_group_v_blocks_donation_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_group_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_youtube" ADD CONSTRAINT "_group_v_blocks_youtube_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_group_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_contactform" ADD CONSTRAINT "_group_v_blocks_contactform_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_group_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v_blocks_button" ADD CONSTRAINT "_group_v_blocks_button_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_group_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v" ADD CONSTRAINT "_group_v_parent_id_group_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."group"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_group_v" ADD CONSTRAINT "_group_v_version_photo_id_media_id_fk" FOREIGN KEY ("version_photo_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_page_header" ADD CONSTRAINT "_pages_v_blocks_page_header_image_id_media_id_fk" FOREIGN KEY ("image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_page_header" ADD CONSTRAINT "_pages_v_blocks_page_header_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_text" ADD CONSTRAINT "_pages_v_blocks_text_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_title" ADD CONSTRAINT "_pages_v_blocks_title_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_section" ADD CONSTRAINT "_pages_v_blocks_section_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_gallery_items" ADD CONSTRAINT "_pages_v_blocks_gallery_items_photo_id_media_id_fk" FOREIGN KEY ("photo_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_gallery_items" ADD CONSTRAINT "_pages_v_blocks_gallery_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v_blocks_gallery"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_gallery" ADD CONSTRAINT "_pages_v_blocks_gallery_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_document" ADD CONSTRAINT "_pages_v_blocks_document_file_id_documents_id_fk" FOREIGN KEY ("file_id") REFERENCES "public"."documents"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_document" ADD CONSTRAINT "_pages_v_blocks_document_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_youtube" ADD CONSTRAINT "_pages_v_blocks_youtube_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_button" ADD CONSTRAINT "_pages_v_blocks_button_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_contactform" ADD CONSTRAINT "_pages_v_blocks_contactform_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_donation" ADD CONSTRAINT "_pages_v_blocks_donation_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_banner" ADD CONSTRAINT "_pages_v_blocks_banner_background_image_id_media_id_fk" FOREIGN KEY ("background_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_banner" ADD CONSTRAINT "_pages_v_blocks_banner_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_main_text" ADD CONSTRAINT "_pages_v_blocks_main_text_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_horizontal_rule" ADD CONSTRAINT "_pages_v_blocks_horizontal_rule_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_blog_slider" ADD CONSTRAINT "_pages_v_blocks_blog_slider_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_mass_times" ADD CONSTRAINT "_pages_v_blocks_mass_times_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v_blocks_events" ADD CONSTRAINT "_pages_v_blocks_events_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."_pages_v"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
ALTER TABLE "_pages_v" ADD CONSTRAINT "_pages_v_parent_id_pages_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."pages"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
CREATE INDEX "_parish_v_version_contact_persons_order_idx" ON "_parish_v_version_contact_persons" USING btree ("_order");
|
||||||
|
CREATE INDEX "_parish_v_version_contact_persons_parent_id_idx" ON "_parish_v_version_contact_persons" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_parish_v_blocks_text_order_idx" ON "_parish_v_blocks_text" USING btree ("_order");
|
||||||
|
CREATE INDEX "_parish_v_blocks_text_parent_id_idx" ON "_parish_v_blocks_text" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_parish_v_blocks_text_path_idx" ON "_parish_v_blocks_text" USING btree ("_path");
|
||||||
|
CREATE INDEX "_parish_v_blocks_document_order_idx" ON "_parish_v_blocks_document" USING btree ("_order");
|
||||||
|
CREATE INDEX "_parish_v_blocks_document_parent_id_idx" ON "_parish_v_blocks_document" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_parish_v_blocks_document_path_idx" ON "_parish_v_blocks_document" USING btree ("_path");
|
||||||
|
CREATE INDEX "_parish_v_blocks_document_file_idx" ON "_parish_v_blocks_document" USING btree ("file_id");
|
||||||
|
CREATE INDEX "_parish_v_blocks_donation_order_idx" ON "_parish_v_blocks_donation" USING btree ("_order");
|
||||||
|
CREATE INDEX "_parish_v_blocks_donation_parent_id_idx" ON "_parish_v_blocks_donation" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_parish_v_blocks_donation_path_idx" ON "_parish_v_blocks_donation" USING btree ("_path");
|
||||||
|
CREATE INDEX "_parish_v_blocks_youtube_order_idx" ON "_parish_v_blocks_youtube" USING btree ("_order");
|
||||||
|
CREATE INDEX "_parish_v_blocks_youtube_parent_id_idx" ON "_parish_v_blocks_youtube" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_parish_v_blocks_youtube_path_idx" ON "_parish_v_blocks_youtube" USING btree ("_path");
|
||||||
|
CREATE INDEX "_parish_v_blocks_donation_appeal_order_idx" ON "_parish_v_blocks_donation_appeal" USING btree ("_order");
|
||||||
|
CREATE INDEX "_parish_v_blocks_donation_appeal_parent_id_idx" ON "_parish_v_blocks_donation_appeal" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_parish_v_blocks_donation_appeal_path_idx" ON "_parish_v_blocks_donation_appeal" USING btree ("_path");
|
||||||
|
CREATE INDEX "_parish_v_version_gallery_order_idx" ON "_parish_v_version_gallery" USING btree ("_order");
|
||||||
|
CREATE INDEX "_parish_v_version_gallery_parent_id_idx" ON "_parish_v_version_gallery" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_parish_v_version_gallery_photo_idx" ON "_parish_v_version_gallery" USING btree ("photo_id");
|
||||||
|
CREATE INDEX "_parish_v_parent_idx" ON "_parish_v" USING btree ("parent_id");
|
||||||
|
CREATE INDEX "_parish_v_version_version_photo_idx" ON "_parish_v" USING btree ("version_photo_id");
|
||||||
|
CREATE INDEX "_parish_v_version_version_updated_at_idx" ON "_parish_v" USING btree ("version_updated_at");
|
||||||
|
CREATE INDEX "_parish_v_version_version_created_at_idx" ON "_parish_v" USING btree ("version_created_at");
|
||||||
|
CREATE INDEX "_parish_v_version_version__status_idx" ON "_parish_v" USING btree ("version__status");
|
||||||
|
CREATE INDEX "_parish_v_created_at_idx" ON "_parish_v" USING btree ("created_at");
|
||||||
|
CREATE INDEX "_parish_v_updated_at_idx" ON "_parish_v" USING btree ("updated_at");
|
||||||
|
CREATE INDEX "_parish_v_latest_idx" ON "_parish_v" USING btree ("latest");
|
||||||
|
CREATE INDEX "_parish_v_rels_order_idx" ON "_parish_v_rels" USING btree ("order");
|
||||||
|
CREATE INDEX "_parish_v_rels_parent_idx" ON "_parish_v_rels" USING btree ("parent_id");
|
||||||
|
CREATE INDEX "_parish_v_rels_path_idx" ON "_parish_v_rels" USING btree ("path");
|
||||||
|
CREATE INDEX "_parish_v_rels_church_id_idx" ON "_parish_v_rels" USING btree ("church_id");
|
||||||
|
CREATE INDEX "_event_v_parent_idx" ON "_event_v" USING btree ("parent_id");
|
||||||
|
CREATE INDEX "_event_v_version_version_location_idx" ON "_event_v" USING btree ("version_location_id");
|
||||||
|
CREATE INDEX "_event_v_version_version_contact_idx" ON "_event_v" USING btree ("version_contact_id");
|
||||||
|
CREATE INDEX "_event_v_version_version_photo_idx" ON "_event_v" USING btree ("version_photo_id");
|
||||||
|
CREATE INDEX "_event_v_version_version_flyer_idx" ON "_event_v" USING btree ("version_flyer_id");
|
||||||
|
CREATE INDEX "_event_v_version_version_updated_at_idx" ON "_event_v" USING btree ("version_updated_at");
|
||||||
|
CREATE INDEX "_event_v_version_version_created_at_idx" ON "_event_v" USING btree ("version_created_at");
|
||||||
|
CREATE INDEX "_event_v_version_version__status_idx" ON "_event_v" USING btree ("version__status");
|
||||||
|
CREATE INDEX "_event_v_created_at_idx" ON "_event_v" USING btree ("created_at");
|
||||||
|
CREATE INDEX "_event_v_updated_at_idx" ON "_event_v" USING btree ("updated_at");
|
||||||
|
CREATE INDEX "_event_v_latest_idx" ON "_event_v" USING btree ("latest");
|
||||||
|
CREATE INDEX "_event_v_rels_order_idx" ON "_event_v_rels" USING btree ("order");
|
||||||
|
CREATE INDEX "_event_v_rels_parent_idx" ON "_event_v_rels" USING btree ("parent_id");
|
||||||
|
CREATE INDEX "_event_v_rels_path_idx" ON "_event_v_rels" USING btree ("path");
|
||||||
|
CREATE INDEX "_event_v_rels_parish_id_idx" ON "_event_v_rels" USING btree ("parish_id");
|
||||||
|
CREATE INDEX "_event_v_rels_group_id_idx" ON "_event_v_rels" USING btree ("group_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_text_order_idx" ON "_group_v_blocks_text" USING btree ("_order");
|
||||||
|
CREATE INDEX "_group_v_blocks_text_parent_id_idx" ON "_group_v_blocks_text" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_text_path_idx" ON "_group_v_blocks_text" USING btree ("_path");
|
||||||
|
CREATE INDEX "_group_v_blocks_gallery_items_order_idx" ON "_group_v_blocks_gallery_items" USING btree ("_order");
|
||||||
|
CREATE INDEX "_group_v_blocks_gallery_items_parent_id_idx" ON "_group_v_blocks_gallery_items" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_gallery_items_photo_idx" ON "_group_v_blocks_gallery_items" USING btree ("photo_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_gallery_order_idx" ON "_group_v_blocks_gallery" USING btree ("_order");
|
||||||
|
CREATE INDEX "_group_v_blocks_gallery_parent_id_idx" ON "_group_v_blocks_gallery" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_gallery_path_idx" ON "_group_v_blocks_gallery" USING btree ("_path");
|
||||||
|
CREATE INDEX "_group_v_blocks_document_order_idx" ON "_group_v_blocks_document" USING btree ("_order");
|
||||||
|
CREATE INDEX "_group_v_blocks_document_parent_id_idx" ON "_group_v_blocks_document" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_document_path_idx" ON "_group_v_blocks_document" USING btree ("_path");
|
||||||
|
CREATE INDEX "_group_v_blocks_document_file_idx" ON "_group_v_blocks_document" USING btree ("file_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_donation_order_idx" ON "_group_v_blocks_donation" USING btree ("_order");
|
||||||
|
CREATE INDEX "_group_v_blocks_donation_parent_id_idx" ON "_group_v_blocks_donation" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_donation_path_idx" ON "_group_v_blocks_donation" USING btree ("_path");
|
||||||
|
CREATE INDEX "_group_v_blocks_youtube_order_idx" ON "_group_v_blocks_youtube" USING btree ("_order");
|
||||||
|
CREATE INDEX "_group_v_blocks_youtube_parent_id_idx" ON "_group_v_blocks_youtube" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_youtube_path_idx" ON "_group_v_blocks_youtube" USING btree ("_path");
|
||||||
|
CREATE INDEX "_group_v_blocks_contactform_order_idx" ON "_group_v_blocks_contactform" USING btree ("_order");
|
||||||
|
CREATE INDEX "_group_v_blocks_contactform_parent_id_idx" ON "_group_v_blocks_contactform" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_contactform_path_idx" ON "_group_v_blocks_contactform" USING btree ("_path");
|
||||||
|
CREATE INDEX "_group_v_blocks_button_order_idx" ON "_group_v_blocks_button" USING btree ("_order");
|
||||||
|
CREATE INDEX "_group_v_blocks_button_parent_id_idx" ON "_group_v_blocks_button" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_group_v_blocks_button_path_idx" ON "_group_v_blocks_button" USING btree ("_path");
|
||||||
|
CREATE INDEX "_group_v_parent_idx" ON "_group_v" USING btree ("parent_id");
|
||||||
|
CREATE INDEX "_group_v_version_version_photo_idx" ON "_group_v" USING btree ("version_photo_id");
|
||||||
|
CREATE INDEX "_group_v_version_version_slug_idx" ON "_group_v" USING btree ("version_slug");
|
||||||
|
CREATE INDEX "_group_v_version_version_updated_at_idx" ON "_group_v" USING btree ("version_updated_at");
|
||||||
|
CREATE INDEX "_group_v_version_version_created_at_idx" ON "_group_v" USING btree ("version_created_at");
|
||||||
|
CREATE INDEX "_group_v_version_version__status_idx" ON "_group_v" USING btree ("version__status");
|
||||||
|
CREATE INDEX "_group_v_created_at_idx" ON "_group_v" USING btree ("created_at");
|
||||||
|
CREATE INDEX "_group_v_updated_at_idx" ON "_group_v" USING btree ("updated_at");
|
||||||
|
CREATE INDEX "_group_v_latest_idx" ON "_group_v" USING btree ("latest");
|
||||||
|
CREATE INDEX "_pages_v_blocks_page_header_order_idx" ON "_pages_v_blocks_page_header" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_page_header_parent_id_idx" ON "_pages_v_blocks_page_header" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_page_header_path_idx" ON "_pages_v_blocks_page_header" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_page_header_image_idx" ON "_pages_v_blocks_page_header" USING btree ("image_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_text_order_idx" ON "_pages_v_blocks_text" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_text_parent_id_idx" ON "_pages_v_blocks_text" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_text_path_idx" ON "_pages_v_blocks_text" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_title_order_idx" ON "_pages_v_blocks_title" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_title_parent_id_idx" ON "_pages_v_blocks_title" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_title_path_idx" ON "_pages_v_blocks_title" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_section_order_idx" ON "_pages_v_blocks_section" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_section_parent_id_idx" ON "_pages_v_blocks_section" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_section_path_idx" ON "_pages_v_blocks_section" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_gallery_items_order_idx" ON "_pages_v_blocks_gallery_items" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_gallery_items_parent_id_idx" ON "_pages_v_blocks_gallery_items" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_gallery_items_photo_idx" ON "_pages_v_blocks_gallery_items" USING btree ("photo_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_gallery_order_idx" ON "_pages_v_blocks_gallery" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_gallery_parent_id_idx" ON "_pages_v_blocks_gallery" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_gallery_path_idx" ON "_pages_v_blocks_gallery" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_document_order_idx" ON "_pages_v_blocks_document" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_document_parent_id_idx" ON "_pages_v_blocks_document" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_document_path_idx" ON "_pages_v_blocks_document" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_document_file_idx" ON "_pages_v_blocks_document" USING btree ("file_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_youtube_order_idx" ON "_pages_v_blocks_youtube" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_youtube_parent_id_idx" ON "_pages_v_blocks_youtube" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_youtube_path_idx" ON "_pages_v_blocks_youtube" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_button_order_idx" ON "_pages_v_blocks_button" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_button_parent_id_idx" ON "_pages_v_blocks_button" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_button_path_idx" ON "_pages_v_blocks_button" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_contactform_order_idx" ON "_pages_v_blocks_contactform" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_contactform_parent_id_idx" ON "_pages_v_blocks_contactform" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_contactform_path_idx" ON "_pages_v_blocks_contactform" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_donation_order_idx" ON "_pages_v_blocks_donation" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_donation_parent_id_idx" ON "_pages_v_blocks_donation" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_donation_path_idx" ON "_pages_v_blocks_donation" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_banner_order_idx" ON "_pages_v_blocks_banner" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_banner_parent_id_idx" ON "_pages_v_blocks_banner" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_banner_path_idx" ON "_pages_v_blocks_banner" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_banner_background_image_idx" ON "_pages_v_blocks_banner" USING btree ("background_image_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_main_text_order_idx" ON "_pages_v_blocks_main_text" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_main_text_parent_id_idx" ON "_pages_v_blocks_main_text" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_main_text_path_idx" ON "_pages_v_blocks_main_text" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_horizontal_rule_order_idx" ON "_pages_v_blocks_horizontal_rule" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_horizontal_rule_parent_id_idx" ON "_pages_v_blocks_horizontal_rule" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_horizontal_rule_path_idx" ON "_pages_v_blocks_horizontal_rule" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_blog_slider_order_idx" ON "_pages_v_blocks_blog_slider" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_blog_slider_parent_id_idx" ON "_pages_v_blocks_blog_slider" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_blog_slider_path_idx" ON "_pages_v_blocks_blog_slider" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_mass_times_order_idx" ON "_pages_v_blocks_mass_times" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_mass_times_parent_id_idx" ON "_pages_v_blocks_mass_times" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_mass_times_path_idx" ON "_pages_v_blocks_mass_times" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_blocks_events_order_idx" ON "_pages_v_blocks_events" USING btree ("_order");
|
||||||
|
CREATE INDEX "_pages_v_blocks_events_parent_id_idx" ON "_pages_v_blocks_events" USING btree ("_parent_id");
|
||||||
|
CREATE INDEX "_pages_v_blocks_events_path_idx" ON "_pages_v_blocks_events" USING btree ("_path");
|
||||||
|
CREATE INDEX "_pages_v_parent_idx" ON "_pages_v" USING btree ("parent_id");
|
||||||
|
CREATE INDEX "_pages_v_version_version_slug_idx" ON "_pages_v" USING btree ("version_slug");
|
||||||
|
CREATE INDEX "_pages_v_version_version_updated_at_idx" ON "_pages_v" USING btree ("version_updated_at");
|
||||||
|
CREATE INDEX "_pages_v_version_version_created_at_idx" ON "_pages_v" USING btree ("version_created_at");
|
||||||
|
CREATE INDEX "_pages_v_version_version__status_idx" ON "_pages_v" USING btree ("version__status");
|
||||||
|
CREATE INDEX "_pages_v_created_at_idx" ON "_pages_v" USING btree ("created_at");
|
||||||
|
CREATE INDEX "_pages_v_updated_at_idx" ON "_pages_v" USING btree ("updated_at");
|
||||||
|
CREATE INDEX "_pages_v_latest_idx" ON "_pages_v" USING btree ("latest");
|
||||||
|
CREATE INDEX "parish__status_idx" ON "parish" USING btree ("_status");
|
||||||
|
CREATE INDEX "event__status_idx" ON "event" USING btree ("_status");
|
||||||
|
CREATE INDEX "group__status_idx" ON "group" USING btree ("_status");
|
||||||
|
CREATE INDEX "pages__status_idx" ON "pages" USING btree ("_status");
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE "blog" SET "_status" = 'published' WHERE "_status" = 'draft';
|
||||||
|
UPDATE "parish" SET "_status" = 'published' WHERE "_status" = 'draft';
|
||||||
|
UPDATE "event" SET "_status" = 'published' WHERE "_status" = 'draft';
|
||||||
|
UPDATE "group" SET "_status" = 'published' WHERE "_status" = 'draft';
|
||||||
|
UPDATE "pages" SET "_status" = 'published' WHERE "_status" = 'draft';
|
||||||
|
|
||||||
|
INSERT INTO "_blog_v" (parent_id, version_photo_id, version_title, version_content_excerpt, version_configuration_show_on_frontpage, version_configuration_display_from_date, version_configuration_display_till_date, version_updated_at, version_created_at, version__status, latest)
|
||||||
|
SELECT id, photo_id, title, content_excerpt, configuration_show_on_frontpage, configuration_display_from_date, configuration_display_till_date, updated_at, created_at, 'published', true
|
||||||
|
FROM "blog" b
|
||||||
|
WHERE NOT EXISTS (SELECT 1 FROM "_blog_v" v WHERE v.parent_id = b.id);
|
||||||
|
|
||||||
|
INSERT INTO "_event_v" (parent_id, version_title, version_date, version_location_id, version_contact_id, version_short_description, version_description, version_rsvp_link, version_photo_id, version_flyer_id, version_cancelled, version_is_recurring, version_updated_at, version_created_at, version__status, latest)
|
||||||
|
SELECT id, title, date, location_id, contact_id, short_description, description, rsvp_link, photo_id, flyer_id, cancelled, is_recurring, updated_at, created_at, 'published', true
|
||||||
|
FROM "event" e
|
||||||
|
WHERE NOT EXISTS (SELECT 1 FROM "_event_v" v WHERE v.parent_id = e.id);
|
||||||
|
|
||||||
|
INSERT INTO "_group_v" (parent_id, version_photo_id, version_name, version_slug, version_short_description, version_text, version_updated_at, version_created_at, version__status, latest)
|
||||||
|
SELECT id, photo_id, name, slug, short_description, text, updated_at, created_at, 'published', true
|
||||||
|
FROM "group" g
|
||||||
|
WHERE NOT EXISTS (SELECT 1 FROM "_group_v" v WHERE v.parent_id = g.id);
|
||||||
|
|
||||||
|
INSERT INTO "_pages_v" (parent_id, version_title, version_description, version_slug, version_updated_at, version_created_at, version__status, latest)
|
||||||
|
SELECT id, title, description, slug, updated_at, created_at, 'published', true
|
||||||
|
FROM "pages" p
|
||||||
|
WHERE NOT EXISTS (SELECT 1 FROM "_pages_v" v WHERE v.parent_id = p.id);
|
||||||
|
|
||||||
|
INSERT INTO "_parish_v" (parent_id, version_name, version_slug, version_description, version_history, version_contact, version_photo_id, version_updated_at, version_created_at, version__status, latest)
|
||||||
|
SELECT id, name, slug, description, history, contact, photo_id, updated_at, created_at, 'published', true
|
||||||
|
FROM "parish" pa
|
||||||
|
WHERE NOT EXISTS (SELECT 1 FROM "_parish_v" v WHERE v.parent_id = pa.id);
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
|
||||||
|
await db.execute(sql`
|
||||||
|
ALTER TABLE "_parish_v_version_contact_persons" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_parish_v_blocks_text" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_parish_v_blocks_document" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_parish_v_blocks_donation" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_parish_v_blocks_youtube" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_parish_v_blocks_donation_appeal" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_parish_v_version_gallery" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_parish_v" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_parish_v_rels" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_event_v" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_event_v_rels" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_group_v_blocks_text" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_group_v_blocks_gallery_items" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_group_v_blocks_gallery" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_group_v_blocks_document" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_group_v_blocks_donation" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_group_v_blocks_youtube" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_group_v_blocks_contactform" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_group_v_blocks_button" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_group_v" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_page_header" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_text" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_title" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_section" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_gallery_items" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_gallery" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_document" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_youtube" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_button" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_contactform" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_donation" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_banner" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_main_text" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_horizontal_rule" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_blog_slider" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_mass_times" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v_blocks_events" DISABLE ROW LEVEL SECURITY;
|
||||||
|
ALTER TABLE "_pages_v" DISABLE ROW LEVEL SECURITY;
|
||||||
|
DROP TABLE "_parish_v_version_contact_persons" CASCADE;
|
||||||
|
DROP TABLE "_parish_v_blocks_text" CASCADE;
|
||||||
|
DROP TABLE "_parish_v_blocks_document" CASCADE;
|
||||||
|
DROP TABLE "_parish_v_blocks_donation" CASCADE;
|
||||||
|
DROP TABLE "_parish_v_blocks_youtube" CASCADE;
|
||||||
|
DROP TABLE "_parish_v_blocks_donation_appeal" CASCADE;
|
||||||
|
DROP TABLE "_parish_v_version_gallery" CASCADE;
|
||||||
|
DROP TABLE "_parish_v" CASCADE;
|
||||||
|
DROP TABLE "_parish_v_rels" CASCADE;
|
||||||
|
DROP TABLE "_event_v" CASCADE;
|
||||||
|
DROP TABLE "_event_v_rels" CASCADE;
|
||||||
|
DROP TABLE "_group_v_blocks_text" CASCADE;
|
||||||
|
DROP TABLE "_group_v_blocks_gallery_items" CASCADE;
|
||||||
|
DROP TABLE "_group_v_blocks_gallery" CASCADE;
|
||||||
|
DROP TABLE "_group_v_blocks_document" CASCADE;
|
||||||
|
DROP TABLE "_group_v_blocks_donation" CASCADE;
|
||||||
|
DROP TABLE "_group_v_blocks_youtube" CASCADE;
|
||||||
|
DROP TABLE "_group_v_blocks_contactform" CASCADE;
|
||||||
|
DROP TABLE "_group_v_blocks_button" CASCADE;
|
||||||
|
DROP TABLE "_group_v" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_page_header" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_text" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_title" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_section" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_gallery_items" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_gallery" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_document" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_youtube" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_button" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_contactform" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_donation" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_banner" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_main_text" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_horizontal_rule" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_blog_slider" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_mass_times" CASCADE;
|
||||||
|
DROP TABLE "_pages_v_blocks_events" CASCADE;
|
||||||
|
DROP TABLE "_pages_v" CASCADE;
|
||||||
|
DROP INDEX "parish__status_idx";
|
||||||
|
DROP INDEX "event__status_idx";
|
||||||
|
DROP INDEX "group__status_idx";
|
||||||
|
DROP INDEX "pages__status_idx";
|
||||||
|
ALTER TABLE "parish_contact_persons" ALTER COLUMN "title" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish_contact_persons" ALTER COLUMN "description" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_text" ALTER COLUMN "content" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_text" ALTER COLUMN "width" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_document" ALTER COLUMN "file_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_document" ALTER COLUMN "button" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish_blocks_youtube" ALTER COLUMN "youtube_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish_gallery" ALTER COLUMN "photo_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "name" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "slug" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "description" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "history" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "contact" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish" ALTER COLUMN "photo_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "announcement" ALTER COLUMN "date" SET DEFAULT '2026-03-15T10:59:47.266Z';
|
||||||
|
ALTER TABLE "calendar" ALTER COLUMN "date" SET DEFAULT '2026-03-15T10:59:47.547Z';
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "title" SET NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "date" SET NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "location_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "short_description" SET NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "description" SET NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "cancelled" SET NOT NULL;
|
||||||
|
ALTER TABLE "event" ALTER COLUMN "is_recurring" SET NOT NULL;
|
||||||
|
ALTER TABLE "classifieds" ALTER COLUMN "until" SET DEFAULT '2026-04-10T09:59:47.604Z';
|
||||||
|
ALTER TABLE "group_blocks_text" ALTER COLUMN "content" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_text" ALTER COLUMN "width" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_gallery_items" ALTER COLUMN "photo_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_document" ALTER COLUMN "file_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_document" ALTER COLUMN "button" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_youtube" ALTER COLUMN "youtube_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_contactform" ALTER COLUMN "title" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_contactform" ALTER COLUMN "description" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_contactform" ALTER COLUMN "email" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_button" ALTER COLUMN "text" SET NOT NULL;
|
||||||
|
ALTER TABLE "group_blocks_button" ALTER COLUMN "url" SET NOT NULL;
|
||||||
|
ALTER TABLE "group" ALTER COLUMN "name" SET NOT NULL;
|
||||||
|
ALTER TABLE "group" ALTER COLUMN "slug" SET NOT NULL;
|
||||||
|
ALTER TABLE "group" ALTER COLUMN "short_description" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_page_header" ALTER COLUMN "title" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_page_header" ALTER COLUMN "description" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_text" ALTER COLUMN "content" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_text" ALTER COLUMN "width" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_title" ALTER COLUMN "title" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_gallery_items" ALTER COLUMN "photo_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_document" ALTER COLUMN "file_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_document" ALTER COLUMN "button" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_youtube" ALTER COLUMN "youtube_id" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_button" ALTER COLUMN "text" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_button" ALTER COLUMN "url" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_contactform" ALTER COLUMN "title" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_contactform" ALTER COLUMN "description" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_contactform" ALTER COLUMN "email" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_main_text" ALTER COLUMN "text" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages_blocks_horizontal_rule" ALTER COLUMN "color" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages" ALTER COLUMN "title" SET NOT NULL;
|
||||||
|
ALTER TABLE "pages" ALTER COLUMN "slug" SET NOT NULL;
|
||||||
|
ALTER TABLE "parish" DROP COLUMN "_status";
|
||||||
|
ALTER TABLE "event" DROP COLUMN "_status";
|
||||||
|
ALTER TABLE "group" DROP COLUMN "_status";
|
||||||
|
ALTER TABLE "pages" DROP COLUMN "_status";
|
||||||
|
DROP TYPE "public"."enum_parish_status";
|
||||||
|
DROP TYPE "public"."enum__parish_v_blocks_text_width";
|
||||||
|
DROP TYPE "public"."enum__parish_v_version_status";
|
||||||
|
DROP TYPE "public"."enum_event_status";
|
||||||
|
DROP TYPE "public"."enum__event_v_version_status";
|
||||||
|
DROP TYPE "public"."enum_group_status";
|
||||||
|
DROP TYPE "public"."enum__group_v_blocks_text_width";
|
||||||
|
DROP TYPE "public"."enum__group_v_version_status";
|
||||||
|
DROP TYPE "public"."enum_pages_status";
|
||||||
|
DROP TYPE "public"."enum__pages_v_blocks_text_width";
|
||||||
|
DROP TYPE "public"."enum__pages_v_blocks_title_size";
|
||||||
|
DROP TYPE "public"."enum__pages_v_blocks_title_align";
|
||||||
|
DROP TYPE "public"."enum__pages_v_blocks_section_background_color";
|
||||||
|
DROP TYPE "public"."enum__pages_v_blocks_section_padding";
|
||||||
|
DROP TYPE "public"."enum__pages_v_blocks_banner_background_position";
|
||||||
|
DROP TYPE "public"."enum__pages_v_blocks_banner_background_size";
|
||||||
|
DROP TYPE "public"."enum__pages_v_blocks_horizontal_rule_color";
|
||||||
|
DROP TYPE "public"."enum__pages_v_version_status";`)
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,8 @@ import * as migration_20260205_155735_version_bump from './20260205_155735_versi
|
||||||
import * as migration_20260309_111617_many_new_features from './20260309_111617_many_new_features';
|
import * as migration_20260309_111617_many_new_features from './20260309_111617_many_new_features';
|
||||||
import * as migration_20260310_105814 from './20260310_105814';
|
import * as migration_20260310_105814 from './20260310_105814';
|
||||||
import * as migration_20260310_143800 from './20260310_143800';
|
import * as migration_20260310_143800 from './20260310_143800';
|
||||||
|
import * as migration_20260311_105947_drop_features from './20260311_105947_drop_features';
|
||||||
|
import * as migration_20260311_110236_live_preview from './20260311_110236_live_preview';
|
||||||
|
|
||||||
export const migrations = [
|
export const migrations = [
|
||||||
{
|
{
|
||||||
|
|
@ -124,6 +126,16 @@ export const migrations = [
|
||||||
{
|
{
|
||||||
up: migration_20260310_143800.up,
|
up: migration_20260310_143800.up,
|
||||||
down: migration_20260310_143800.down,
|
down: migration_20260310_143800.down,
|
||||||
name: '20260310_143800'
|
name: '20260310_143800',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
up: migration_20260311_105947_drop_features.up,
|
||||||
|
down: migration_20260311_105947_drop_features.down,
|
||||||
|
name: '20260311_105947_drop_features',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
up: migration_20260311_110236_live_preview.up,
|
||||||
|
down: migration_20260311_110236_live_preview.down,
|
||||||
|
name: '20260311_110236_live_preview',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -237,6 +237,7 @@ export interface Parish {
|
||||||
| null;
|
| null;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
_status?: ('draft' | 'published') | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
@ -517,6 +518,7 @@ export interface Event {
|
||||||
isRecurring: boolean;
|
isRecurring: boolean;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
_status?: ('draft' | 'published') | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
@ -633,6 +635,7 @@ export interface Group {
|
||||||
| null;
|
| null;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
_status?: ('draft' | 'published') | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
@ -851,31 +854,6 @@ export interface Page {
|
||||||
blockName?: string | null;
|
blockName?: string | null;
|
||||||
blockType: 'massTimes';
|
blockType: 'massTimes';
|
||||||
}
|
}
|
||||||
| {
|
|
||||||
title: string;
|
|
||||||
text: string;
|
|
||||||
image: string | Media;
|
|
||||||
content: {
|
|
||||||
root: {
|
|
||||||
type: string;
|
|
||||||
children: {
|
|
||||||
type: any;
|
|
||||||
version: number;
|
|
||||||
[k: string]: unknown;
|
|
||||||
}[];
|
|
||||||
direction: ('ltr' | 'rtl') | null;
|
|
||||||
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
|
||||||
indent: number;
|
|
||||||
version: number;
|
|
||||||
};
|
|
||||||
[k: string]: unknown;
|
|
||||||
};
|
|
||||||
backgroundColor?: ('none' | 'soft' | 'off-white') | null;
|
|
||||||
schema?: ('base' | 'contrast') | null;
|
|
||||||
id?: string | null;
|
|
||||||
blockName?: string | null;
|
|
||||||
blockType: 'collapsibleImageWithText';
|
|
||||||
}
|
|
||||||
| {
|
| {
|
||||||
title?: string | null;
|
title?: string | null;
|
||||||
itemsPerPage?: number | null;
|
itemsPerPage?: number | null;
|
||||||
|
|
@ -883,15 +861,11 @@ export interface Page {
|
||||||
blockName?: string | null;
|
blockName?: string | null;
|
||||||
blockType: 'events';
|
blockType: 'events';
|
||||||
}
|
}
|
||||||
| {
|
|
||||||
id?: string | null;
|
|
||||||
blockName?: string | null;
|
|
||||||
blockType: 'publicationAndNewsletter';
|
|
||||||
}
|
|
||||||
)[]
|
)[]
|
||||||
| null;
|
| null;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
_status?: ('draft' | 'published') | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
@ -1154,6 +1128,7 @@ export interface ParishSelect<T extends boolean = true> {
|
||||||
};
|
};
|
||||||
updatedAt?: T;
|
updatedAt?: T;
|
||||||
createdAt?: T;
|
createdAt?: T;
|
||||||
|
_status?: T;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
@ -1334,6 +1309,7 @@ export interface EventSelect<T extends boolean = true> {
|
||||||
isRecurring?: T;
|
isRecurring?: T;
|
||||||
updatedAt?: T;
|
updatedAt?: T;
|
||||||
createdAt?: T;
|
createdAt?: T;
|
||||||
|
_status?: T;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
@ -1445,6 +1421,7 @@ export interface GroupSelect<T extends boolean = true> {
|
||||||
};
|
};
|
||||||
updatedAt?: T;
|
updatedAt?: T;
|
||||||
createdAt?: T;
|
createdAt?: T;
|
||||||
|
_status?: T;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
@ -1595,18 +1572,6 @@ export interface PagesSelect<T extends boolean = true> {
|
||||||
id?: T;
|
id?: T;
|
||||||
blockName?: T;
|
blockName?: T;
|
||||||
};
|
};
|
||||||
collapsibleImageWithText?:
|
|
||||||
| T
|
|
||||||
| {
|
|
||||||
title?: T;
|
|
||||||
text?: T;
|
|
||||||
image?: T;
|
|
||||||
content?: T;
|
|
||||||
backgroundColor?: T;
|
|
||||||
schema?: T;
|
|
||||||
id?: T;
|
|
||||||
blockName?: T;
|
|
||||||
};
|
|
||||||
events?:
|
events?:
|
||||||
| T
|
| T
|
||||||
| {
|
| {
|
||||||
|
|
@ -1615,15 +1580,10 @@ export interface PagesSelect<T extends boolean = true> {
|
||||||
id?: T;
|
id?: T;
|
||||||
blockName?: T;
|
blockName?: T;
|
||||||
};
|
};
|
||||||
publicationAndNewsletter?:
|
|
||||||
| T
|
|
||||||
| {
|
|
||||||
id?: T;
|
|
||||||
blockName?: T;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
updatedAt?: T;
|
updatedAt?: T;
|
||||||
createdAt?: T;
|
createdAt?: T;
|
||||||
|
_status?: T;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ export default buildConfig({
|
||||||
},
|
},
|
||||||
livePreview: {
|
livePreview: {
|
||||||
url: 'http://localhost:3000',
|
url: 'http://localhost:3000',
|
||||||
collections: ['blog'],
|
collections: ['blog', 'event', 'group', 'pages', 'parish'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
collections: [
|
collections: [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue