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";`)
}
