import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'

export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
  await db.execute(sql`
DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_background_color" AS ENUM('white', 'light', 'dark', 'transparent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_behavior" AS ENUM('single', 'multiple', 'at-least-one');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_header_background" AS ENUM('white', 'light', 'transparent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_icon_position" AS ENUM('left', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_icon_style" AS ENUM('chevron', 'plus-minus', 'arrow', 'caret');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_items_badge_color" AS ENUM('gray', 'blue', 'green', 'yellow', 'red', 'purple');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_items_code_content_language" AS ENUM('javascript', 'typescript', 'html', 'css', 'json', 'python', 'bash');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_items_content_type" AS ENUM('richtext', 'image-text', 'list', 'table', 'code');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_items_icon" AS ENUM('none', 'info', 'question', 'star', 'check', 'warning', 'document', 'user', 'settings', 'code', 'lightbulb', 'lock');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_items_img_txt_img_pos" AS ENUM('left', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_items_list_items_icon" AS ENUM('check', 'dot', 'arrow', 'star', 'x');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_layout" AS ENUM('full', 'centered', 'narrow', 'two-column');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_style" AS ENUM('default', 'bordered', 'separated', 'flush', 'rounded');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_accordion_title_size" AS ENUM('small', 'medium', 'large');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_author_bio_block_layout" AS ENUM('card', 'inline', 'compact', 'feature');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_author_bio_block_show_bio" AS ENUM('none', 'short', 'full');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_author_bio_block_source" AS ENUM('post', 'manual');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_author_bio_block_style_avatar_shape" AS ENUM('circle', 'square', 'rounded');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_author_bio_block_style_avatar_size" AS ENUM('sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_author_bio_block_style_bg" AS ENUM('none', 'light', 'dark', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_aspect_ratio" AS ENUM('original', '16-9', '4-3', '3-2', '1-1', '2-3', '9-16');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_background_color" AS ENUM('transparent', 'white', 'light', 'dark', 'black');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_border_radius" AS ENUM('none', 'small', 'medium', 'large');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_comparisons_category" AS ENUM('wedding', 'portrait', 'retouch', 'colorgrade', 'restore', 'composing', 'architecture', 'product', 'other');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_cta_cta_style" AS ENUM('primary', 'secondary', 'outline', 'ghost');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_display_style" AS ENUM('slider', 'hover', 'toggle', 'side-by-side', 'fade');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_label_position" AS ENUM('corners', 'top', 'bottom', 'overlay');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_label_style" AS ENUM('badge', 'text', 'pill');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_layout" AS ENUM('single', 'grid-2', 'grid-3', 'carousel', 'masonry');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_shadow" AS ENUM('none', 'small', 'medium', 'large');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_slider_handle_color" AS ENUM('white', 'black', 'primary', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_slider_handle_size" AS ENUM('small', 'medium', 'large');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_slider_handle_style" AS ENUM('circle', 'line', 'arrows', 'custom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_slider_orientation" AS ENUM('horizontal', 'vertical');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_before_after_spacing" AS ENUM('none', 'small', 'medium', 'large');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_card_grid_block_columns" AS ENUM('2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_comparison_background_color" AS ENUM('white', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_comparison_before_after_display_style" AS ENUM('slider', 'side-by-side', 'stacked', 'flip');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_comparison_check_color" AS ENUM('green', 'primary', 'blue');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_comparison_comparison_type" AS ENUM('table', 'cards', 'before-after', 'pros-cons', 'feature-matrix');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_comparison_crd_items_accent_color" AS ENUM('default', 'primary', 'secondary', 'green', 'blue');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_comparison_cross_color" AS ENUM('red', 'gray', 'transparent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_comparison_mobile_view" AS ENUM('scroll', 'stacked', 'accordion', 'dropdown');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_comparison_table_style" AS ENUM('bordered', 'striped', 'minimal', 'cards');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_comparison_tbl_rows_values_value_type" AS ENUM('text', 'boolean', 'partial', 'na');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_cta_block_background_color" AS ENUM('dark', 'light', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_cta_block_buttons_style" AS ENUM('primary', 'secondary', 'outline');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_divider_block_spacing" AS ENUM('small', 'medium', 'large');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_divider_block_style" AS ENUM('line', 'space', 'dots');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_category" AS ENUM('brochure', 'flyer', 'catalog', 'pricelist', 'form', 'manual', 'datasheet', 'certificate', 'press', 'whitepaper', 'presentation', 'legal');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_columns" AS ENUM('1', '2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_file_icons_icon_style" AS ENUM('colored', 'mono', 'outline');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_filters_filter_layout" AS ENUM('horizontal', 'sidebar', 'dropdown');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_group_by" AS ENUM('none', 'category', 'fileType');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_layout" AS ENUM('list', 'cards', 'compact', 'table', 'accordion');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_pagination_type" AS ENUM('none', 'button', 'pagination');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_sort_by" AS ENUM('order', 'title_asc', 'title_desc', 'date_desc', 'date_asc', 'downloads_desc', 'size');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_source" AS ENUM('all', 'category', 'tags', 'featured', 'service', 'product', 'manual');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_style_bg" AS ENUM('none', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_style_card_style" AS ENUM('simple', 'bordered', 'shadow');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_style_gap" AS ENUM('8', '16', '24');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_downloads_block_style_hover_effect" AS ENUM('none', 'highlight', 'lift');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_background_color" AS ENUM('white', 'light', 'dark', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_calendar_options_default_view" AS ENUM('month', 'week', 'day');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_card_style" AS ENUM('elevated', 'bordered', 'flat');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_columns" AS ENUM('2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_event_type" AS ENUM('event', 'workshop', 'seminar', 'webinar', 'conference', 'tradeshow', 'networking', 'course', 'talk');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_filter_mode" AS ENUM('upcoming', 'past', 'all', 'featured', 'type', 'category');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_group_by" AS ENUM('none', 'month', 'type', 'category');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_layout" AS ENUM('cards', 'list', 'compact', 'timeline', 'calendar', 'agenda');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_sort_order" AS ENUM('asc', 'desc');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_events_source_mode" AS ENUM('collection', 'selected');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_faq_block_background_color" AS ENUM('white', 'light', 'dark', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_faq_block_columns" AS ENUM('2', '3');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_faq_block_display_mode" AS ENUM('all', 'featured', 'category', 'selected');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_faq_block_layout" AS ENUM('accordion', 'grid', 'list', 'two-column');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_faq_block_source_mode" AS ENUM('collection', 'inline');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_block_alignment" AS ENUM('left', 'center', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_block_cta_style" AS ENUM('primary', 'secondary', 'outline');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_layout_content_width" AS ENUM('container', 'narrow', 'wide', 'full');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_layout_height" AS ENUM('viewport', 'large', 'medium', 'small', 'compact', 'auto');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_layout_mobile_height" AS ENUM('same', 'viewport', 'large', 'medium', 'small', 'compact');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_navigation_arrows_position" AS ENUM('sides', 'bottom-left', 'bottom-right', 'bottom-center');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_navigation_arrows_style" AS ENUM('default', 'minimal', 'square', 'hover-only');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_navigation_dots_color" AS ENUM('white', 'dark', 'primary');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_navigation_dots_position" AS ENUM('bottom-center', 'bottom-left', 'bottom-right', 'left', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_navigation_dots_style" AS ENUM('dots', 'lines', 'numbers', 'thumbnails', 'progress');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_settings_animation" AS ENUM('fade', 'slide', 'zoom', 'flip', 'none');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_settings_animation_duration" AS ENUM('300', '500', '800', '1200');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_settings_autoplay_interval" AS ENUM('3000', '4000', '5000', '6000', '7000', '8000', '10000');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_slides_overlay_color" AS ENUM('dark', 'light', 'primary', 'gradient-bottom', 'gradient-top');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_slides_overlay_opacity" AS ENUM('20', '30', '40', '50', '60', '70', '80');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_slides_primary_cta_style" AS ENUM('primary', 'secondary', 'outline-white', 'outline-dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_slides_secondary_cta_style" AS ENUM('primary', 'secondary', 'outline-white', 'outline-dark', 'text');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_slides_text_alignment" AS ENUM('left', 'center', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_slides_text_color" AS ENUM('white', 'dark', 'primary');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_hero_slider_block_slides_vertical_position" AS ENUM('top', 'center', 'bottom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_grid_aspect_ratio" AS ENUM('square', '4-3', '16-9', '3-4', 'auto');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_grid_cols" AS ENUM('2', '3', '4', '5', '6');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_grid_gap" AS ENUM('0', '8', '16', '24', '32');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_layout" AS ENUM('slider', 'grid', 'masonry', 'single', 'thumbs', 'filmstrip');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_lightbox_bg" AS ENUM('dark', 'light', 'blur');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_nav_arrow_style" AS ENUM('default', 'minimal', 'square', 'hover');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_nav_dot_style" AS ENUM('dots', 'lines', 'numbers', 'progress');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_slider_delay" AS ENUM('3000', '4000', '5000', '6000', '8000');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_slider_effect" AS ENUM('slide', 'fade', 'zoom', 'flip', 'coverflow', 'cube');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_slider_gap" AS ENUM('0', '8', '16', '24');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_slider_per_view" AS ENUM('1', '2', '3', '4', 'auto');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_slider_speed" AS ENUM('300', '500', '800');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_style_bg" AS ENUM('none', 'white', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_style_caption_pos" AS ENUM('below', 'overlay', 'hover', 'hidden');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_style_height" AS ENUM('auto', '300', '400', '500', '600', 'full');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_style_hover_effect" AS ENUM('none', 'zoom', 'brighten', 'darken', 'overlay');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_style_img_fit" AS ENUM('cover', 'contain', 'fill');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_style_padding" AS ENUM('none', 'sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_slider_block_style_rounded" AS ENUM('none', 'sm', 'md', 'lg', 'full');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_image_text_block_image_position" AS ENUM('left', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_category" AS ENUM('care', 'medical', 'admin', 'it', 'marketing', 'sales', 'finance', 'hr', 'production', 'logistics');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_columns" AS ENUM('1', '2', '3');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_filters_filter_layout" AS ENUM('horizontal', 'sidebar', 'dropdown');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_layout" AS ENUM('list', 'cards', 'compact', 'accordion');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_pagination_type" AS ENUM('button', 'pagination', 'infinite', 'none');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_source" AS ENUM('all', 'category', 'department', 'location', 'featured', 'manual');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_style_bg" AS ENUM('none', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_style_card_style" AS ENUM('simple', 'bordered', 'shadow');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_style_gap" AS ENUM('8', '16', '24');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_jobs_block_style_hover_effect" AS ENUM('none', 'lift', 'highlight');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_columns" AS ENUM('1', '2', '3');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_layout" AS ENUM('map-list', 'map-only', 'list-only', 'cards', 'accordion', 'tabs');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_location_type" AS ENUM('headquarters', 'office', 'branch', 'warehouse', 'showroom', 'studio', 'practice', 'workshop');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_map_height" AS ENUM('300', '400', '500', '600');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_map_marker_style" AS ENUM('pin', 'dot', 'icon', 'custom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_map_position" AS ENUM('left', 'right', 'top', 'bottom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_map_provider" AS ENUM('osm', 'google', 'mapbox');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_map_style" AS ENUM('default', 'light', 'dark', 'satellite');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_source" AS ENUM('all', 'main', 'type', 'manual');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_style_bg" AS ENUM('none', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_style_card_style" AS ENUM('simple', 'bordered', 'shadow', 'filled');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_locations_block_style_gap" AS ENUM('16', '24', '32');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_columns" AS ENUM('3', '4', '5', '6', '8');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_layout" AS ENUM('grid', 'slider', 'marquee', 'inline', 'masonry');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_logo_style_hover_effect" AS ENUM('none', 'scale', 'brighten', 'shadow');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_logo_style_max_height" AS ENUM('40', '50', '60', '80', '100');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_logo_style_opacity" AS ENUM('50', '70', '100');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_logo_style_size" AS ENUM('sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_partner_type" AS ENUM('all', 'partner', 'client', 'reference', 'sponsor', 'certification', 'membership', 'award', 'supplier', 'technology');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_slider_per_view" AS ENUM('3', '4', '5', '6', 'auto');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_slider_speed" AS ENUM('5000', '3000', '2000');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_source" AS ENUM('collection', 'manual');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_style_alignment" AS ENUM('left', 'center', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_style_bg" AS ENUM('none', 'light', 'white', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_style_gap" AS ENUM('16', '24', '32', '48');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_logo_grid_block_style_logo_bg" AS ENUM('none', 'white', 'light');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_location_type" AS ENUM('all', 'headquarters', 'branch', 'office', 'warehouse', 'production', 'showroom', 'service', 'partner');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_map_settings_height" AS ENUM('300', '400', '500', '600', 'fullscreen');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_map_style" AS ENUM('default', 'light', 'dark', 'satellite', 'hybrid', 'terrain');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_marker_style_size" AS ENUM('sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_marker_style_type" AS ENUM('pin', 'dot', 'icon', 'custom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_markers_marker_type" AS ENUM('default', 'main', 'highlight', 'custom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_popup_trigger" AS ENUM('click', 'hover');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_provider" AS ENUM('osm', 'google', 'mapbox', 'leaflet');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_sidebar_position" AS ENUM('left', 'right', 'bottom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_sidebar_width" AS ENUM('250', '300', '400');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_source" AS ENUM('locations', 'manual', 'single');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_map_block_style_padding" AS ENUM('none', 'sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_newsletter_block_available_interests" AS ENUM('general', 'blog', 'products', 'offers', 'events');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_newsletter_block_background_color" AS ENUM('white', 'light', 'dark', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_newsletter_block_image_position" AS ENUM('left', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_newsletter_block_layout" AS ENUM('inline', 'stacked', 'with-image', 'minimal', 'card');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_connectors_color" AS ENUM('gray', 'dark', 'accent', 'gradient');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_connectors_style" AS ENUM('straight', 'angular', 'curved', 'dashed');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_connectors_thickness" AS ENUM('1', '2', '3');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_direction" AS ENUM('top', 'bottom', 'left', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_layout" AS ENUM('tree', 'tree-horizontal', 'org', 'radial', 'layers');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_node_click_action" AS ENUM('none', 'modal', 'link', 'expand');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_node_image_shape" AS ENUM('circle', 'rounded', 'square');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_node_image_size" AS ENUM('sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_node_style" AS ENUM('card', 'compact', 'avatar', 'text');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_source" AS ENUM('auto', 'department', 'manual');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_style_bg" AS ENUM('none', 'light', 'white', 'dark', 'gradient');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_style_min_height" AS ENUM('auto', '300', '400', '500', '600', 'full');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_style_node_bg" AS ENUM('white', 'light', 'transparent', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_org_chart_block_style_spacing" AS ENUM('sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_posts_list_block_background_color" AS ENUM('white', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_posts_list_block_columns" AS ENUM('2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_posts_list_block_layout" AS ENUM('grid', 'list', 'featured', 'compact', 'masonry');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_posts_list_block_post_type" AS ENUM('blog', 'news', 'press', 'announcement', 'all');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_pricing_alignment" AS ENUM('left', 'center', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_pricing_background_color" AS ENUM('white', 'light', 'dark', 'gradient');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_pricing_card_style" AS ENUM('elevated', 'bordered', 'flat', 'glass');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_pricing_guarantee_icon" AS ENUM('shield', 'check', 'star', 'lock');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_pricing_layout" AS ENUM('cards', 'table', 'compact');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_pricing_plans_accent_color" AS ENUM('default', 'primary', 'secondary', 'green', 'blue', 'purple');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_pricing_plans_cta_style" AS ENUM('primary', 'secondary', 'outline');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_pricing_pricing_type" AS ENUM('one-time', 'monthly', 'yearly', 'toggle', 'custom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_process_steps_block_background_color" AS ENUM('white', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_process_steps_block_cta_variant" AS ENUM('default', 'ghost', 'light');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_process_steps_block_layout" AS ENUM('horizontal', 'vertical', 'alternating', 'connected', 'timeline');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_quote_block_style" AS ENUM('simple', 'highlighted', 'with-image');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_related_posts_block_cols" AS ENUM('2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_related_posts_block_layout" AS ENUM('grid', 'list', 'slider', 'compact', 'cards');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_related_posts_block_source" AS ENUM('auto', 'manual', 'category', 'tag', 'latest', 'popular', 'author');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_related_posts_block_style_bg" AS ENUM('none', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_related_posts_block_style_gap" AS ENUM('16', '24', '32');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_related_posts_block_style_hover" AS ENUM('none', 'lift', 'zoom', 'overlay');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_related_posts_block_style_img_ratio" AS ENUM('square', '4-3', '16-9', '3-4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_related_posts_block_style_rounded" AS ENUM('none', 'sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_services_block_background_color" AS ENUM('white', 'light', 'dark', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_services_block_card_style" AS ENUM('elevated', 'bordered', 'flat', 'filled');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_services_block_columns" AS ENUM('2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_services_block_display_mode" AS ENUM('all', 'featured', 'category', 'selected');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_services_block_layout" AS ENUM('grid', 'list', 'tabs', 'accordion', 'featured-grid', 'slider', 'compact', 'masonry');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_services_block_slides_per_view" AS ENUM('1', '2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_services_block_tabs_style" AS ENUM('horizontal', 'vertical', 'pills');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_share_buttons_block_align" AS ENUM('left', 'center', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_share_buttons_block_float_side" AS ENUM('left', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_share_buttons_block_layout" AS ENUM('horizontal', 'vertical', 'floating', 'sticky');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_share_buttons_block_style_color_scheme" AS ENUM('brand', 'gray', 'dark', 'light', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_share_buttons_block_style_gap" AS ENUM('0', '4', '8', '12');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_share_buttons_block_style_shape" AS ENUM('square', 'rounded', 'circle', 'pill');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_share_buttons_block_style_size" AS ENUM('sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_share_buttons_block_style_variant" AS ENUM('filled', 'outline', 'icon', 'minimal');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_alignment" AS ENUM('left', 'center', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_animation_duration" AS ENUM('1000', '2000', '3000');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_animation_trigger" AS ENUM('viewport', 'immediate');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_columns" AS ENUM('2', '3', '4', 'auto');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_layout" AS ENUM('row', 'grid', 'cards', 'column', 'inline', 'feature');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_stats_color" AS ENUM('default', 'primary', 'green', 'blue', 'orange', 'red');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_stats_icon" AS ENUM('none', 'users', 'star', 'heart', 'check', 'trophy', 'chart', 'clock', 'calendar', 'globe', 'building', 'document', 'target', 'rocket', 'handshake');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_style_bg" AS ENUM('none', 'light', 'dark', 'primary', 'gradient');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_style_bg_overlay" AS ENUM('none', 'dark', 'light', 'primary');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_style_gap" AS ENUM('16', '24', '32', '48');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_style_icon_position" AS ENUM('top', 'left', 'inline');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_style_padding" AS ENUM('none', 'sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_style_text_color" AS ENUM('auto', 'dark', 'light');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_style_value_size" AS ENUM('base', 'lg', 'xl', '2xl');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_stats_block_style_value_weight" AS ENUM('normal', 'medium', 'bold', 'extrabold');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_background_color" AS ENUM('white', 'light', 'dark', 'transparent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_content_background" AS ENUM('white', 'light', 'transparent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_mobile_style" AS ENUM('scroll', 'dropdown', 'accordion', 'stacked');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tab_alignment" AS ENUM('left', 'center', 'right', 'stretch');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tab_position" AS ENUM('top', 'left', 'right', 'bottom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tab_style" AS ENUM('underline', 'boxed', 'pills', 'buttons', 'vertical');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tabs_code_language" AS ENUM('javascript', 'typescript', 'html', 'css', 'json', 'python', 'bash', 'sql');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tabs_content_type" AS ENUM('richtext', 'image-text', 'features', 'code', 'embed');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tabs_embed_aspect_ratio" AS ENUM('16:9', '4:3', '1:1');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tabs_embed_type" AS ENUM('youtube', 'vimeo', 'iframe');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tabs_features_icon" AS ENUM('check', 'star', 'arrow', 'dot', 'number');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tabs_icon" AS ENUM('none', 'info', 'star', 'heart', 'check', 'settings', 'user', 'document', 'image', 'video', 'code', 'chart', 'calendar', 'location', 'email', 'phone');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_tabs_tabs_img_txt_img_pos" AS ENUM('left', 'right', 'top');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_block_background_color" AS ENUM('white', 'light', 'dark', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_block_columns" AS ENUM('2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_block_display_mode" AS ENUM('all', 'featured', 'department', 'selected');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_block_image_style" AS ENUM('circle', 'rounded', 'square');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_block_layout" AS ENUM('grid', 'list', 'slider', 'compact', 'detailed');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_card_image_style" AS ENUM('circle', 'rounded', 'square');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_display_columns" AS ENUM('2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_display_layout" AS ENUM('grid', 'list', 'compact');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_display_load_more" AS ENUM('button', 'infinite', 'pagination', 'all');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_filters_filter_layout" AS ENUM('horizontal', 'sidebar', 'dropdown', 'tabs');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_filters_filter_style" AS ENUM('buttons', 'select', 'checkbox');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_style_animation" AS ENUM('none', 'fade', 'slide', 'scale');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_style_bg" AS ENUM('none', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_style_card_bg" AS ENUM('white', 'transparent', 'light');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_style_card_hover" AS ENUM('none', 'lift', 'shadow', 'border');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_team_filter_block_style_gap" AS ENUM('16', '24', '32');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_columns" AS ENUM('2', '3', '4');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_display_mode" AS ENUM('all', 'selected');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_layout" AS ENUM('slider', 'grid', 'single', 'masonry', 'list');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_nav_arrow_pos" AS ENUM('sides', 'bl', 'br', 'bc');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_nav_arrow_style" AS ENUM('default', 'minimal', 'square', 'hover', 'outside');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_nav_dot_pos" AS ENUM('bottom', 'bl', 'br');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_nav_dot_style" AS ENUM('dots', 'lines', 'numbers', 'progress', 'fraction');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_slider_delay" AS ENUM('3000', '4000', '5000', '6000', '8000', '10000');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_slider_effect" AS ENUM('slide', 'fade', 'cards', 'coverflow', 'none');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_slider_gap" AS ENUM('0', '16', '24', '32', '48');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_slider_per_view" AS ENUM('1', '2', '3', 'auto');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_slider_speed" AS ENUM('300', '500', '800');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_style_align" AS ENUM('left', 'center', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_style_bg" AS ENUM('white', 'light', 'dark', 'accent', 'none');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_style_card" AS ENUM('shadow', 'border', 'flat', 'glass');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_style_img_pos" AS ENUM('top', 'left', 'bottom', 'bg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_style_img_size" AS ENUM('sm', 'md', 'lg', 'xl');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_style_quote" AS ENUM('icon', 'quotes', 'none', 'large');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_testimonials_block_style_spacing" AS ENUM('sm', 'normal', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_text_block_width" AS ENUM('narrow', 'medium', 'full');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_timeline_block_background_color" AS ENUM('white', 'light', 'dark');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_timeline_block_layout" AS ENUM('vertical', 'alternating', 'horizontal');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_timeline_block_marker_style" AS ENUM('dot', 'number', 'icon', 'date');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_toc_block_behavior_progress_style" AS ENUM('bar', 'percent', 'circle');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_toc_block_layout" AS ENUM('list', 'numbered', 'inline', 'sidebar', 'dropdown');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_toc_block_sidebar_pos" AS ENUM('left', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_toc_block_style_bg" AS ENUM('none', 'light', 'dark', 'accent');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_toc_block_style_border_side" AS ENUM('all', 'left', 'top');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_toc_block_style_font_size" AS ENUM('sm', 'base', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_toc_block_style_line_height" AS ENUM('tight', 'normal', 'relaxed');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_toc_block_style_rounded" AS ENUM('none', 'sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_block_alignment" AS ENUM('left', 'center', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_block_aspect_ratio" AS ENUM('16:9', '4:3', '1:1', '9:16', '21:9');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_block_size" AS ENUM('full', 'large', 'medium', 'small');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_block_source_type" AS ENUM('embed', 'upload', 'library', 'external');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_block_style_rounded" AS ENUM('none', 'sm', 'md', 'lg', 'xl');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_block_style_shadow" AS ENUM('none', 'sm', 'md', 'lg', 'xl');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"behavior" "enum_pages_blocks_accordion_behavior" DEFAULT 'single',
	"expand_first" boolean DEFAULT false,
	"animated" boolean DEFAULT true,
	"style" "enum_pages_blocks_accordion_style" DEFAULT 'default',
	"icon_position" "enum_pages_blocks_accordion_icon_position" DEFAULT 'right',
	"icon_style" "enum_pages_blocks_accordion_icon_style" DEFAULT 'chevron',
	"layout" "enum_pages_blocks_accordion_layout" DEFAULT 'full',
	"title_size" "enum_pages_blocks_accordion_title_size" DEFAULT 'medium',
	"background_color" "enum_pages_blocks_accordion_background_color" DEFAULT 'white',
	"header_background" "enum_pages_blocks_accordion_header_background" DEFAULT 'white',
	"enable_schema_org" boolean DEFAULT false,
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_items" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"icon" "enum_pages_blocks_accordion_items_icon",
	"custom_icon_id" integer,
	"content_type" "enum_pages_blocks_accordion_items_content_type" DEFAULT 'richtext',
	"img_txt_img_id" integer,
	"img_txt_img_pos" "enum_pages_blocks_accordion_items_img_txt_img_pos" DEFAULT 'left',
	"code_content_language" "enum_pages_blocks_accordion_items_code_content_language",
	"code_content_code" varchar,
	"badge" varchar,
	"badge_color" "enum_pages_blocks_accordion_items_badge_color",
	"default_open" boolean DEFAULT false,
	"disabled" boolean DEFAULT false
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_items_list_items" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"icon" "enum_pages_blocks_accordion_items_list_items_icon" DEFAULT 'check'
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_items_list_items_locales" (
	"text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_items_locales" (
	"title" varchar NOT NULL,
	"subtitle" varchar,
	"content" jsonb,
	"img_txt_text" jsonb,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_items_table_data_headers" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_items_table_data_headers_locales" (
	"text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_items_table_data_rows" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_items_table_data_rows_cells" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_items_table_data_rows_cells_locales" (
	"text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_accordion_locales" (
	"title" varchar,
	"subtitle" varchar,
	"description" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_before_after" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"display_style" "enum_pages_blocks_before_after_display_style" DEFAULT 'slider',
	"slider_orientation" "enum_pages_blocks_before_after_slider_orientation" DEFAULT 'horizontal',
	"slider_start_position" numeric DEFAULT 50,
	"layout" "enum_pages_blocks_before_after_layout" DEFAULT 'single',
	"aspect_ratio" "enum_pages_blocks_before_after_aspect_ratio" DEFAULT 'original',
	"slider_handle_style" "enum_pages_blocks_before_after_slider_handle_style" DEFAULT 'circle',
	"slider_handle_color" "enum_pages_blocks_before_after_slider_handle_color" DEFAULT 'white',
	"slider_handle_size" "enum_pages_blocks_before_after_slider_handle_size" DEFAULT 'medium',
	"slider_handle_show_line" boolean DEFAULT true,
	"show_labels" boolean DEFAULT true,
	"label_position" "enum_pages_blocks_before_after_label_position" DEFAULT 'corners',
	"label_style" "enum_pages_blocks_before_after_label_style" DEFAULT 'badge',
	"show_filter" boolean DEFAULT false,
	"animation_enable_animation" boolean DEFAULT true,
	"animation_auto_play" boolean DEFAULT false,
	"animation_auto_play_speed" numeric DEFAULT 3,
	"animation_scroll_trigger" boolean DEFAULT true,
	"interactivity_enable_zoom" boolean DEFAULT false,
	"interactivity_enable_fullscreen" boolean DEFAULT true,
	"interactivity_enable_swipe" boolean DEFAULT true,
	"interactivity_enable_keyboard" boolean DEFAULT true,
	"cta_show_cta" boolean DEFAULT false,
	"cta_cta_link" varchar,
	"cta_cta_style" "enum_pages_blocks_before_after_cta_cta_style" DEFAULT 'primary',
	"background_color" "enum_pages_blocks_before_after_background_color" DEFAULT 'transparent',
	"border_radius" "enum_pages_blocks_before_after_border_radius" DEFAULT 'medium',
	"shadow" "enum_pages_blocks_before_after_shadow" DEFAULT 'medium',
	"spacing" "enum_pages_blocks_before_after_spacing" DEFAULT 'medium',
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_before_after_comparisons" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"before_image_id" integer NOT NULL,
	"after_image_id" integer NOT NULL,
	"category" "enum_pages_blocks_before_after_comparisons_category",
	"tags" varchar,
	"metadata_client" varchar,
	"metadata_date" timestamp(3) with time zone,
	"metadata_tools" varchar,
	"metadata_duration" varchar,
	"show_metadata" boolean DEFAULT false
);

CREATE TABLE IF NOT EXISTS "pages_blocks_before_after_comparisons_locales" (
	"title" varchar,
	"before_label" varchar DEFAULT 'Vorher',
	"after_label" varchar DEFAULT 'Nachher',
	"description" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_before_after_locales" (
	"title" varchar,
	"subtitle" varchar,
	"description" varchar,
	"cta_cta_text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"comparison_type" "enum_pages_blocks_comparison_comparison_type" DEFAULT 'table',
	"before_after_display_style" "enum_pages_blocks_comparison_before_after_display_style" DEFAULT 'slider',
	"sticky_header" boolean DEFAULT true,
	"show_categories" boolean DEFAULT true,
	"collapsible_categories" boolean DEFAULT false,
	"show_row_dividers" boolean DEFAULT true,
	"highlight_differences" boolean DEFAULT false,
	"mobile_view" "enum_pages_blocks_comparison_mobile_view" DEFAULT 'scroll',
	"symbols_check_symbol" varchar DEFAULT '✓',
	"symbols_cross_symbol" varchar DEFAULT '✗',
	"symbols_partial_symbol" varchar DEFAULT '○',
	"background_color" "enum_pages_blocks_comparison_background_color" DEFAULT 'white',
	"table_style" "enum_pages_blocks_comparison_table_style" DEFAULT 'bordered',
	"check_color" "enum_pages_blocks_comparison_check_color" DEFAULT 'green',
	"cross_color" "enum_pages_blocks_comparison_cross_color" DEFAULT 'red',
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_before_after_items" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"before_image_id" integer,
	"after_image_id" integer
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_before_after_items_locales" (
	"title" varchar,
	"before_text" varchar,
	"after_text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_crd_items" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"image_id" integer,
	"cta_link" varchar,
	"is_highlighted" boolean DEFAULT false,
	"accent_color" "enum_pages_blocks_comparison_crd_items_accent_color"
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_crd_items_features" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"included" boolean DEFAULT true
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_crd_items_features_locales" (
	"text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_crd_items_locales" (
	"title" varchar,
	"subtitle" varchar,
	"description" jsonb,
	"price" varchar,
	"cta_text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_locales" (
	"title" varchar,
	"subtitle" varchar,
	"description" varchar,
	"before_after_before_label" varchar DEFAULT 'Vorher',
	"before_after_after_label" varchar DEFAULT 'Nachher',
	"pros_cons_pros_label" varchar DEFAULT 'Vorteile',
	"pros_cons_cons_label" varchar DEFAULT 'Nachteile',
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_pros_cons_items" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"image_id" integer,
	"rating" numeric
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_cons" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_cons_locales" (
	"text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_locales" (
	"title" varchar,
	"verdict" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_pros" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_pros_locales" (
	"text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_tbl_columns" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"image_id" integer,
	"is_highlighted" boolean DEFAULT false,
	"cta_link" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_tbl_columns_locales" (
	"name" varchar,
	"subtitle" varchar,
	"price" varchar,
	"highlight_label" varchar,
	"cta_text" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_tbl_rows" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"category" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_tbl_rows_locales" (
	"feature" varchar,
	"tooltip" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_tbl_rows_values" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"column_index" numeric,
	"value_type" "enum_pages_blocks_comparison_tbl_rows_values_value_type" DEFAULT 'text',
	"boolean_value" boolean
);

CREATE TABLE IF NOT EXISTS "pages_blocks_comparison_tbl_rows_values_locales" (
	"text_value" varchar,
	"partial_note" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_downloads_block" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"source" "enum_pages_blocks_downloads_block_source" DEFAULT 'all',
	"category" "enum_pages_blocks_downloads_block_category",
	"filter_tags" varchar,
	"related_service_id" integer,
	"related_product_id" integer,
	"limit" numeric DEFAULT 20,
	"filters_show_search" boolean DEFAULT true,
	"filters_show_category_filter" boolean DEFAULT true,
	"filters_show_file_type_filter" boolean DEFAULT false,
	"filters_filter_layout" "enum_pages_blocks_downloads_block_filters_filter_layout" DEFAULT 'horizontal',
	"layout" "enum_pages_blocks_downloads_block_layout" DEFAULT 'list',
	"columns" "enum_pages_blocks_downloads_block_columns" DEFAULT '1',
	"show_thumbnail" boolean DEFAULT true,
	"show_description" boolean DEFAULT true,
	"show_file_size" boolean DEFAULT true,
	"show_file_type" boolean DEFAULT true,
	"show_category" boolean DEFAULT true,
	"show_download_count" boolean DEFAULT false,
	"show_version" boolean DEFAULT false,
	"show_last_updated" boolean DEFAULT false,
	"download_behavior_direct_download" boolean DEFAULT true,
	"download_behavior_track_downloads" boolean DEFAULT true,
	"download_behavior_open_in_new_tab" boolean DEFAULT false,
	"file_icons_show_file_type_icon" boolean DEFAULT true,
	"file_icons_icon_style" "enum_pages_blocks_downloads_block_file_icons_icon_style" DEFAULT 'colored',
	"sort_by" "enum_pages_blocks_downloads_block_sort_by" DEFAULT 'order',
	"group_by" "enum_pages_blocks_downloads_block_group_by" DEFAULT 'none',
	"pagination_type" "enum_pages_blocks_downloads_block_pagination_type" DEFAULT 'none',
	"pagination_per_page" numeric DEFAULT 10,
	"style_bg" "enum_pages_blocks_downloads_block_style_bg" DEFAULT 'none',
	"style_card_style" "enum_pages_blocks_downloads_block_style_card_style" DEFAULT 'bordered',
	"style_hover_effect" "enum_pages_blocks_downloads_block_style_hover_effect" DEFAULT 'highlight',
	"style_gap" "enum_pages_blocks_downloads_block_style_gap" DEFAULT '16',
	"show_all_downloads_link" boolean DEFAULT false,
	"all_downloads_url" varchar DEFAULT '/downloads',
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_downloads_block_locales" (
	"title" varchar DEFAULT 'Downloads',
	"subtitle" varchar,
	"introduction" jsonb,
	"empty_state_title" varchar DEFAULT 'Keine Downloads verfügbar',
	"empty_state_message" varchar DEFAULT 'Aktuell sind keine Downloads in dieser Kategorie verfügbar.',
	"all_downloads_text" varchar DEFAULT 'Alle Downloads ansehen',
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_events" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"source_mode" "enum_pages_blocks_events_source_mode" DEFAULT 'collection',
	"filter_mode" "enum_pages_blocks_events_filter_mode" DEFAULT 'upcoming',
	"event_type" "enum_pages_blocks_events_event_type",
	"category" varchar,
	"limit" numeric DEFAULT 6,
	"layout" "enum_pages_blocks_events_layout" DEFAULT 'cards',
	"columns" "enum_pages_blocks_events_columns" DEFAULT '3',
	"show_image" boolean DEFAULT true,
	"show_excerpt" boolean DEFAULT true,
	"show_date" boolean DEFAULT true,
	"show_time" boolean DEFAULT true,
	"show_location" boolean DEFAULT true,
	"show_price" boolean DEFAULT false,
	"show_event_type" boolean DEFAULT false,
	"show_registration_button" boolean DEFAULT true,
	"calendar_options_default_view" "enum_pages_blocks_events_calendar_options_default_view" DEFAULT 'month',
	"calendar_options_show_navigation" boolean DEFAULT true,
	"calendar_options_show_view_toggle" boolean DEFAULT false,
	"group_by" "enum_pages_blocks_events_group_by" DEFAULT 'none',
	"sort_order" "enum_pages_blocks_events_sort_order" DEFAULT 'asc',
	"show_all_link" boolean DEFAULT true,
	"all_events_link" varchar DEFAULT '/events',
	"background_color" "enum_pages_blocks_events_background_color" DEFAULT 'white',
	"card_style" "enum_pages_blocks_events_card_style" DEFAULT 'elevated',
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_events_locales" (
	"title" varchar,
	"subtitle" varchar,
	"registration_button_text" varchar DEFAULT 'Jetzt anmelden',
	"all_events_text" varchar DEFAULT 'Alle Veranstaltungen',
	"empty_message" varchar DEFAULT 'Aktuell sind keine Veranstaltungen geplant.',
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_jobs_block" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"source" "enum_pages_blocks_jobs_block_source" DEFAULT 'all',
	"category" "enum_pages_blocks_jobs_block_category",
	"department" varchar,
	"location_filter_id" integer,
	"limit" numeric DEFAULT 10,
	"filters_show_search" boolean DEFAULT true,
	"filters_show_category_filter" boolean DEFAULT true,
	"filters_show_type_filter" boolean DEFAULT true,
	"filters_show_location_filter" boolean DEFAULT true,
	"filters_show_work_model_filter" boolean DEFAULT false,
	"filters_filter_layout" "enum_pages_blocks_jobs_block_filters_filter_layout" DEFAULT 'horizontal',
	"layout" "enum_pages_blocks_jobs_block_layout" DEFAULT 'list',
	"columns" "enum_pages_blocks_jobs_block_columns" DEFAULT '1',
	"show_image" boolean DEFAULT false,
	"show_department" boolean DEFAULT true,
	"show_type" boolean DEFAULT true,
	"show_location" boolean DEFAULT true,
	"show_work_model" boolean DEFAULT true,
	"show_salary" boolean DEFAULT false,
	"show_summary" boolean DEFAULT true,
	"show_deadline" boolean DEFAULT false,
	"show_publish_date" boolean DEFAULT true,
	"show_badges" boolean DEFAULT true,
	"badges_new_days" numeric DEFAULT 7,
	"badges_show_urgent" boolean DEFAULT true,
	"badges_show_featured" boolean DEFAULT true,
	"pagination_type" "enum_pages_blocks_jobs_block_pagination_type" DEFAULT 'button',
	"pagination_per_page" numeric DEFAULT 10,
	"style_bg" "enum_pages_blocks_jobs_block_style_bg" DEFAULT 'none',
	"style_card_style" "enum_pages_blocks_jobs_block_style_card_style" DEFAULT 'bordered',
	"style_hover_effect" "enum_pages_blocks_jobs_block_style_hover_effect" DEFAULT 'lift',
	"style_gap" "enum_pages_blocks_jobs_block_style_gap" DEFAULT '16',
	"empty_state_show_initiative_link" boolean DEFAULT true,
	"empty_state_initiative_url" varchar DEFAULT '/karriere/initiativbewerbung',
	"show_all_jobs_link" boolean DEFAULT false,
	"all_jobs_url" varchar DEFAULT '/karriere',
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_jobs_block_locales" (
	"title" varchar DEFAULT 'Offene Stellen',
	"subtitle" varchar,
	"introduction" jsonb,
	"empty_state_title" varchar DEFAULT 'Aktuell keine offenen Stellen',
	"empty_state_message" varchar DEFAULT 'Schauen Sie später wieder vorbei oder senden Sie uns eine Initiativbewerbung.',
	"empty_state_initiative_text" varchar DEFAULT 'Initiativbewerbung senden',
	"all_jobs_text" varchar DEFAULT 'Alle offenen Stellen',
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_locations_block" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"source" "enum_pages_blocks_locations_block_source" DEFAULT 'all',
	"location_type" "enum_pages_blocks_locations_block_location_type",
	"layout" "enum_pages_blocks_locations_block_layout" DEFAULT 'map-list',
	"map_position" "enum_pages_blocks_locations_block_map_position" DEFAULT 'left',
	"columns" "enum_pages_blocks_locations_block_columns" DEFAULT '2',
	"map_provider" "enum_pages_blocks_locations_block_map_provider" DEFAULT 'osm',
	"map_style" "enum_pages_blocks_locations_block_map_style" DEFAULT 'default',
	"map_height" "enum_pages_blocks_locations_block_map_height" DEFAULT '400',
	"map_default_zoom" numeric DEFAULT 12,
	"map_fit_bounds" boolean DEFAULT true,
	"map_marker_style" "enum_pages_blocks_locations_block_map_marker_style" DEFAULT 'pin',
	"map_marker_color" varchar DEFAULT '#e11d48',
	"map_clustering" boolean DEFAULT true,
	"map_controls_zoom" boolean DEFAULT true,
	"map_controls_fullscreen" boolean DEFAULT true,
	"map_controls_scroll_zoom" boolean DEFAULT false,
	"map_controls_dragging" boolean DEFAULT true,
	"show_image" boolean DEFAULT true,
	"show_type" boolean DEFAULT false,
	"show_address" boolean DEFAULT true,
	"show_phone" boolean DEFAULT true,
	"show_email" boolean DEFAULT true,
	"show_hours" boolean DEFAULT true,
	"show_directions" boolean DEFAULT false,
	"show_services" boolean DEFAULT false,
	"show_team" boolean DEFAULT false,
	"actions_show_directions_link" boolean DEFAULT true,
	"actions_show_call_button" boolean DEFAULT true,
	"actions_show_email_button" boolean DEFAULT false,
	"actions_show_detail_link" boolean DEFAULT false,
	"actions_detail_base_path" varchar DEFAULT '/standorte',
	"style_bg" "enum_pages_blocks_locations_block_style_bg" DEFAULT 'none',
	"style_card_style" "enum_pages_blocks_locations_block_style_card_style" DEFAULT 'bordered',
	"style_gap" "enum_pages_blocks_locations_block_style_gap" DEFAULT '24',
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_locations_block_locales" (
	"title" varchar DEFAULT 'Unsere Standorte',
	"subtitle" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_logo_grid_block" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"source" "enum_pages_blocks_logo_grid_block_source" DEFAULT 'collection',
	"featured_only" boolean DEFAULT false,
	"limit" numeric DEFAULT 12,
	"layout" "enum_pages_blocks_logo_grid_block_layout" DEFAULT 'grid',
	"columns" "enum_pages_blocks_logo_grid_block_columns" DEFAULT '4',
	"slider_per_view" "enum_pages_blocks_logo_grid_block_slider_per_view" DEFAULT '4',
	"slider_autoplay" boolean DEFAULT true,
	"slider_speed" "enum_pages_blocks_logo_grid_block_slider_speed" DEFAULT '3000',
	"slider_pause_on_hover" boolean DEFAULT true,
	"slider_show_arrows" boolean DEFAULT false,
	"slider_show_dots" boolean DEFAULT false,
	"logo_style_size" "enum_pages_blocks_logo_grid_block_logo_style_size" DEFAULT 'md',
	"logo_style_max_height" "enum_pages_blocks_logo_grid_block_logo_style_max_height" DEFAULT '60',
	"logo_style_grayscale" boolean DEFAULT true,
	"logo_style_color_on_hover" boolean DEFAULT true,
	"logo_style_opacity" "enum_pages_blocks_logo_grid_block_logo_style_opacity" DEFAULT '70',
	"logo_style_hover_effect" "enum_pages_blocks_logo_grid_block_logo_style_hover_effect" DEFAULT 'scale',
	"behavior_link_to_website" boolean DEFAULT false,
	"behavior_open_in_new_tab" boolean DEFAULT true,
	"behavior_show_tooltip" boolean DEFAULT true,
	"behavior_show_name" boolean DEFAULT false,
	"style_bg" "enum_pages_blocks_logo_grid_block_style_bg" DEFAULT 'none',
	"style_logo_bg" "enum_pages_blocks_logo_grid_block_style_logo_bg" DEFAULT 'none',
	"style_logo_padding" boolean DEFAULT true,
	"style_gap" "enum_pages_blocks_logo_grid_block_style_gap" DEFAULT '32',
	"style_alignment" "enum_pages_blocks_logo_grid_block_style_alignment" DEFAULT 'center',
	"style_divider" boolean DEFAULT false,
	"show_c_t_a" boolean DEFAULT false,
	"cta_link" varchar DEFAULT '/partner',
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_logo_grid_block_locales" (
	"title" varchar,
	"subtitle" varchar,
	"cta_text" varchar DEFAULT 'Alle Partner ansehen',
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_logo_grid_block_logos" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"logo_id" integer,
	"name" varchar,
	"link" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_logo_grid_block_partner_type" (
	"order" integer NOT NULL,
	"parent_id" varchar NOT NULL,
	"value" "enum_pages_blocks_logo_grid_block_partner_type",
	"id" serial PRIMARY KEY NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_map_block" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"source" "enum_pages_blocks_map_block_source" DEFAULT 'locations',
	"single_address_street" varchar,
	"single_address_zip" varchar,
	"single_address_city" varchar,
	"single_address_country" varchar DEFAULT 'Deutschland',
	"single_address_lat" numeric,
	"single_address_lng" numeric,
	"provider" "enum_pages_blocks_map_block_provider" DEFAULT 'osm',
	"map_style" "enum_pages_blocks_map_block_map_style" DEFAULT 'default',
	"map_settings_height" "enum_pages_blocks_map_block_map_settings_height" DEFAULT '400',
	"map_settings_zoom" numeric DEFAULT 12,
	"map_settings_auto_fit" boolean DEFAULT true,
	"map_settings_center_lat" numeric,
	"map_settings_center_lng" numeric,
	"interaction_scroll_zoom" boolean DEFAULT false,
	"interaction_dragging" boolean DEFAULT true,
	"interaction_zoom_control" boolean DEFAULT true,
	"interaction_fullscreen_control" boolean DEFAULT false,
	"interaction_locate_control" boolean DEFAULT false,
	"marker_style_type" "enum_pages_blocks_map_block_marker_style_type" DEFAULT 'pin',
	"marker_style_color" varchar DEFAULT '#3B82F6',
	"marker_style_size" "enum_pages_blocks_map_block_marker_style_size" DEFAULT 'md',
	"marker_style_clustering" boolean DEFAULT true,
	"marker_style_cluster_radius" numeric DEFAULT 50,
	"popup_show" boolean DEFAULT true,
	"popup_trigger" "enum_pages_blocks_map_block_popup_trigger" DEFAULT 'click',
	"popup_show_address" boolean DEFAULT true,
	"popup_show_directions_link" boolean DEFAULT true,
	"popup_show_phone" boolean DEFAULT true,
	"popup_show_opening_hours" boolean DEFAULT false,
	"popup_show_detail_link" boolean DEFAULT true,
	"sidebar_show" boolean DEFAULT false,
	"sidebar_position" "enum_pages_blocks_map_block_sidebar_position" DEFAULT 'right',
	"sidebar_width" "enum_pages_blocks_map_block_sidebar_width" DEFAULT '300',
	"sidebar_searchable" boolean DEFAULT true,
	"sidebar_click_to_center" boolean DEFAULT true,
	"style_rounded" boolean DEFAULT true,
	"style_shadow" boolean DEFAULT true,
	"style_border" boolean DEFAULT false,
	"style_padding" "enum_pages_blocks_map_block_style_padding" DEFAULT 'none',
	"fallback_show_static_image" boolean DEFAULT false,
	"fallback_static_image_id" integer,
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_map_block_locales" (
	"title" varchar,
	"subtitle" varchar,
	"single_address_name" varchar,
	"fallback_no_js_message" varchar DEFAULT 'Bitte aktivieren Sie JavaScript, um die Karte anzuzeigen.',
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_map_block_location_type" (
	"order" integer NOT NULL,
	"parent_id" varchar NOT NULL,
	"value" "enum_pages_blocks_map_block_location_type",
	"id" serial PRIMARY KEY NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_map_block_markers" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"lat" numeric,
	"lng" numeric,
	"marker_type" "enum_pages_blocks_map_block_markers_marker_type",
	"custom_icon_id" integer,
	"link" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_map_block_markers_locales" (
	"name" varchar,
	"address" varchar,
	"popup_content" jsonb,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"pricing_type" "enum_pages_blocks_pricing_pricing_type" DEFAULT 'one-time',
	"currency" varchar DEFAULT '€',
	"show_currency_before" boolean DEFAULT true,
	"toggle_options_default_to_yearly" boolean DEFAULT true,
	"show_comparison" boolean DEFAULT false,
	"layout" "enum_pages_blocks_pricing_layout" DEFAULT 'cards',
	"alignment" "enum_pages_blocks_pricing_alignment" DEFAULT 'center',
	"highlight_popular" boolean DEFAULT true,
	"guarantee_show" boolean DEFAULT false,
	"guarantee_icon" "enum_pages_blocks_pricing_guarantee_icon",
	"show_f_a_q" boolean DEFAULT false,
	"background_color" "enum_pages_blocks_pricing_background_color" DEFAULT 'white',
	"card_style" "enum_pages_blocks_pricing_card_style" DEFAULT 'elevated',
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_comparison_features" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_comparison_features_locales" (
	"category" varchar,
	"feature" varchar,
	"tooltip" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_comparison_features_values" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"plan_index" numeric
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_comparison_features_values_locales" (
	"value" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_faq_items" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_faq_items_locales" (
	"question" varchar,
	"answer" jsonb,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_locales" (
	"title" varchar,
	"subtitle" varchar,
	"description" varchar,
	"toggle_options_monthly_label" varchar DEFAULT 'Monatlich',
	"toggle_options_yearly_label" varchar DEFAULT 'Jährlich',
	"toggle_options_yearly_discount" varchar,
	"guarantee_text" varchar DEFAULT '30 Tage Geld-zurück-Garantie',
	"faq_title" varchar DEFAULT 'Häufig gestellte Fragen',
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_plans" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"price" numeric,
	"price_monthly" numeric,
	"price_yearly" numeric,
	"original_price" numeric,
	"cta_link" varchar,
	"cta_style" "enum_pages_blocks_pricing_plans_cta_style" DEFAULT 'primary',
	"is_popular" boolean DEFAULT false,
	"is_recommended" boolean DEFAULT false,
	"accent_color" "enum_pages_blocks_pricing_plans_accent_color",
	"icon_id" integer
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_plans_features" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"included" boolean DEFAULT true,
	"highlight" boolean DEFAULT false
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_plans_features_locales" (
	"text" varchar NOT NULL,
	"tooltip" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_pricing_plans_locales" (
	"name" varchar NOT NULL,
	"subtitle" varchar,
	"description" varchar,
	"price_suffix" varchar,
	"price_note" varchar,
	"custom_price_text" varchar,
	"cta_text" varchar DEFAULT 'Jetzt starten',
	"popular_label" varchar DEFAULT 'Beliebt',
	"recommended_label" varchar DEFAULT 'Empfohlen',
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_stats_block" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"layout" "enum_pages_blocks_stats_block_layout" DEFAULT 'row',
	"columns" "enum_pages_blocks_stats_block_columns" DEFAULT '4',
	"alignment" "enum_pages_blocks_stats_block_alignment" DEFAULT 'center',
	"animation_count_up" boolean DEFAULT true,
	"animation_duration" "enum_pages_blocks_stats_block_animation_duration" DEFAULT '2000',
	"animation_trigger" "enum_pages_blocks_stats_block_animation_trigger" DEFAULT 'viewport',
	"animation_stagger" boolean DEFAULT true,
	"style_bg" "enum_pages_blocks_stats_block_style_bg" DEFAULT 'none',
	"style_bg_image_id" integer,
	"style_bg_overlay" "enum_pages_blocks_stats_block_style_bg_overlay" DEFAULT 'dark',
	"style_text_color" "enum_pages_blocks_stats_block_style_text_color" DEFAULT 'auto',
	"style_value_size" "enum_pages_blocks_stats_block_style_value_size" DEFAULT 'xl',
	"style_value_weight" "enum_pages_blocks_stats_block_style_value_weight" DEFAULT 'bold',
	"style_show_icon" boolean DEFAULT true,
	"style_icon_position" "enum_pages_blocks_stats_block_style_icon_position" DEFAULT 'top',
	"style_dividers" boolean DEFAULT false,
	"style_card_border" boolean DEFAULT false,
	"style_card_shadow" boolean DEFAULT true,
	"style_gap" "enum_pages_blocks_stats_block_style_gap" DEFAULT '32',
	"style_padding" "enum_pages_blocks_stats_block_style_padding" DEFAULT 'md',
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_stats_block_locales" (
	"title" varchar,
	"subtitle" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_stats_block_stats" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"value" varchar NOT NULL,
	"numeric_value" numeric,
	"prefix" varchar,
	"suffix" varchar,
	"icon" "enum_pages_blocks_stats_block_stats_icon",
	"color" "enum_pages_blocks_stats_block_stats_color"
);

CREATE TABLE IF NOT EXISTS "pages_blocks_stats_block_stats_locales" (
	"label" varchar NOT NULL,
	"description" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_tabs" (
	"_order" integer NOT NULL,
	"_parent_id" integer NOT NULL,
	"_path" text NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"tab_style" "enum_pages_blocks_tabs_tab_style" DEFAULT 'underline',
	"tab_position" "enum_pages_blocks_tabs_tab_position" DEFAULT 'top',
	"tab_alignment" "enum_pages_blocks_tabs_tab_alignment" DEFAULT 'left',
	"default_tab" numeric DEFAULT 0,
	"allow_keyboard_navigation" boolean DEFAULT true,
	"animated" boolean DEFAULT true,
	"lazy" boolean DEFAULT false,
	"mobile_style" "enum_pages_blocks_tabs_mobile_style" DEFAULT 'scroll',
	"background_color" "enum_pages_blocks_tabs_background_color" DEFAULT 'white',
	"content_background" "enum_pages_blocks_tabs_content_background" DEFAULT 'white',
	"show_border" boolean DEFAULT true,
	"full_width" boolean DEFAULT false,
	"block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_tabs_locales" (
	"title" varchar,
	"subtitle" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_tabs_tabs" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"icon" "enum_pages_blocks_tabs_tabs_icon",
	"custom_icon_id" integer,
	"badge" varchar,
	"content_type" "enum_pages_blocks_tabs_tabs_content_type" DEFAULT 'richtext',
	"img_txt_img_id" integer,
	"img_txt_img_pos" "enum_pages_blocks_tabs_tabs_img_txt_img_pos" DEFAULT 'left',
	"code_language" "enum_pages_blocks_tabs_tabs_code_language",
	"code_code" varchar,
	"code_show_line_numbers" boolean DEFAULT true,
	"embed_type" "enum_pages_blocks_tabs_tabs_embed_type",
	"embed_url" varchar,
	"embed_aspect_ratio" "enum_pages_blocks_tabs_tabs_embed_aspect_ratio" DEFAULT '16:9'
);

CREATE TABLE IF NOT EXISTS "pages_blocks_tabs_tabs_features" (
	"_order" integer NOT NULL,
	"_parent_id" varchar NOT NULL,
	"id" varchar PRIMARY KEY NOT NULL,
	"icon" "enum_pages_blocks_tabs_tabs_features_icon"
);

CREATE TABLE IF NOT EXISTS "pages_blocks_tabs_tabs_features_locales" (
	"title" varchar,
	"description" varchar,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

CREATE TABLE IF NOT EXISTS "pages_blocks_tabs_tabs_locales" (
	"label" varchar NOT NULL,
	"content" jsonb,
	"img_txt_text" jsonb,
	"id" serial PRIMARY KEY NOT NULL,
	"_locale" "_locales" NOT NULL,
	"_parent_id" varchar NOT NULL
);

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion" ADD CONSTRAINT "pages_blocks_accordion_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items" ADD CONSTRAINT "pages_blocks_accordion_items_custom_icon_id_media_id_fk" FOREIGN KEY ("custom_icon_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items" ADD CONSTRAINT "pages_blocks_accordion_items_img_txt_img_id_media_id_fk" FOREIGN KEY ("img_txt_img_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items" ADD CONSTRAINT "pages_blocks_accordion_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items_list_items" ADD CONSTRAINT "pages_blocks_accordion_items_list_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items_list_items_locales" ADD CONSTRAINT "pages_blocks_accordion_items_list_items_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion_items_list_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items_locales" ADD CONSTRAINT "pages_blocks_accordion_items_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items_table_data_headers" ADD CONSTRAINT "pages_blocks_accordion_items_table_data_headers_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items_table_data_headers_locales" ADD CONSTRAINT "pages_blocks_accordion_items_table_data_headers_locales_p_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion_items_table_data_headers"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items_table_data_rows" ADD CONSTRAINT "pages_blocks_accordion_items_table_data_rows_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items_table_data_rows_cells" ADD CONSTRAINT "pages_blocks_accordion_items_table_data_rows_cells_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion_items_table_data_rows"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_items_table_data_rows_cells_locales" ADD CONSTRAINT "pages_blocks_accordion_items_table_data_rows_cells_locale_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion_items_table_data_rows_cells"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_accordion_locales" ADD CONSTRAINT "pages_blocks_accordion_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_accordion"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_before_after" ADD CONSTRAINT "pages_blocks_before_after_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_before_after_comparisons" ADD CONSTRAINT "pages_blocks_before_after_comparisons_after_image_id_media_id_fk" FOREIGN KEY ("after_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_before_after_comparisons" ADD CONSTRAINT "pages_blocks_before_after_comparisons_before_image_id_media_id_fk" FOREIGN KEY ("before_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_before_after_comparisons" ADD CONSTRAINT "pages_blocks_before_after_comparisons_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_before_after"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_before_after_comparisons_locales" ADD CONSTRAINT "pages_blocks_before_after_comparisons_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_before_after_comparisons"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_before_after_locales" ADD CONSTRAINT "pages_blocks_before_after_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_before_after"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison" ADD CONSTRAINT "pages_blocks_comparison_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_before_after_items" ADD CONSTRAINT "pages_blocks_comparison_before_after_items_after_image_id_media_id_fk" FOREIGN KEY ("after_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_before_after_items" ADD CONSTRAINT "pages_blocks_comparison_before_after_items_before_image_id_media_id_fk" FOREIGN KEY ("before_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_before_after_items" ADD CONSTRAINT "pages_blocks_comparison_before_after_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_before_after_items_locales" ADD CONSTRAINT "pages_blocks_comparison_before_after_items_locales_parent_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_before_after_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_crd_items" ADD CONSTRAINT "pages_blocks_comparison_crd_items_image_id_media_id_fk" FOREIGN KEY ("image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_crd_items" ADD CONSTRAINT "pages_blocks_comparison_crd_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_crd_items_features" ADD CONSTRAINT "pages_blocks_comparison_crd_items_features_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_crd_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_crd_items_features_locales" ADD CONSTRAINT "pages_blocks_comparison_crd_items_features_locales_parent_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_crd_items_features"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_crd_items_locales" ADD CONSTRAINT "pages_blocks_comparison_crd_items_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_crd_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_locales" ADD CONSTRAINT "pages_blocks_comparison_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_pros_cons_items" ADD CONSTRAINT "pages_blocks_comparison_pros_cons_items_image_id_media_id_fk" FOREIGN KEY ("image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_pros_cons_items" ADD CONSTRAINT "pages_blocks_comparison_pros_cons_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_pros_cons_items_cons" ADD CONSTRAINT "pages_blocks_comparison_pros_cons_items_cons_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_pros_cons_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_pros_cons_items_cons_locales" ADD CONSTRAINT "pages_blocks_comparison_pros_cons_items_cons_locales_pare_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_pros_cons_items_cons"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_pros_cons_items_locales" ADD CONSTRAINT "pages_blocks_comparison_pros_cons_items_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_pros_cons_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_pros_cons_items_pros" ADD CONSTRAINT "pages_blocks_comparison_pros_cons_items_pros_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_pros_cons_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_pros_cons_items_pros_locales" ADD CONSTRAINT "pages_blocks_comparison_pros_cons_items_pros_locales_pare_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_pros_cons_items_pros"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_tbl_columns" ADD CONSTRAINT "pages_blocks_comparison_tbl_columns_image_id_media_id_fk" FOREIGN KEY ("image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_tbl_columns" ADD CONSTRAINT "pages_blocks_comparison_tbl_columns_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_tbl_columns_locales" ADD CONSTRAINT "pages_blocks_comparison_tbl_columns_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_tbl_columns"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_tbl_rows" ADD CONSTRAINT "pages_blocks_comparison_tbl_rows_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_tbl_rows_locales" ADD CONSTRAINT "pages_blocks_comparison_tbl_rows_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_tbl_rows"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_tbl_rows_values" ADD CONSTRAINT "pages_blocks_comparison_tbl_rows_values_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_tbl_rows"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_comparison_tbl_rows_values_locales" ADD CONSTRAINT "pages_blocks_comparison_tbl_rows_values_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_comparison_tbl_rows_values"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_downloads_block" ADD CONSTRAINT "pages_blocks_downloads_block_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_downloads_block" ADD CONSTRAINT "pages_blocks_downloads_block_related_product_id_products_id_fk" FOREIGN KEY ("related_product_id") REFERENCES "public"."products"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_downloads_block" ADD CONSTRAINT "pages_blocks_downloads_block_related_service_id_services_id_fk" FOREIGN KEY ("related_service_id") REFERENCES "public"."services"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_downloads_block_locales" ADD CONSTRAINT "pages_blocks_downloads_block_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_downloads_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_events" ADD CONSTRAINT "pages_blocks_events_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_events_locales" ADD CONSTRAINT "pages_blocks_events_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_events"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_jobs_block" ADD CONSTRAINT "pages_blocks_jobs_block_location_filter_id_locations_id_fk" FOREIGN KEY ("location_filter_id") REFERENCES "public"."locations"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_jobs_block" ADD CONSTRAINT "pages_blocks_jobs_block_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_jobs_block_locales" ADD CONSTRAINT "pages_blocks_jobs_block_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_jobs_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_locations_block" ADD CONSTRAINT "pages_blocks_locations_block_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_locations_block_locales" ADD CONSTRAINT "pages_blocks_locations_block_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_locations_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_logo_grid_block" ADD CONSTRAINT "pages_blocks_logo_grid_block_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_logo_grid_block_locales" ADD CONSTRAINT "pages_blocks_logo_grid_block_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_logo_grid_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_logo_grid_block_logos" ADD CONSTRAINT "pages_blocks_logo_grid_block_logos_logo_id_media_id_fk" FOREIGN KEY ("logo_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_logo_grid_block_logos" ADD CONSTRAINT "pages_blocks_logo_grid_block_logos_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_logo_grid_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_logo_grid_block_partner_type" ADD CONSTRAINT "pages_blocks_logo_grid_block_partner_type_parent_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."pages_blocks_logo_grid_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_map_block" ADD CONSTRAINT "pages_blocks_map_block_fallback_static_image_id_media_id_fk" FOREIGN KEY ("fallback_static_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_map_block" ADD CONSTRAINT "pages_blocks_map_block_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_map_block_locales" ADD CONSTRAINT "pages_blocks_map_block_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_map_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_map_block_location_type" ADD CONSTRAINT "pages_blocks_map_block_location_type_parent_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."pages_blocks_map_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_map_block_markers" ADD CONSTRAINT "pages_blocks_map_block_markers_custom_icon_id_media_id_fk" FOREIGN KEY ("custom_icon_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_map_block_markers" ADD CONSTRAINT "pages_blocks_map_block_markers_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_map_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_map_block_markers_locales" ADD CONSTRAINT "pages_blocks_map_block_markers_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_map_block_markers"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing" ADD CONSTRAINT "pages_blocks_pricing_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_comparison_features" ADD CONSTRAINT "pages_blocks_pricing_comparison_features_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_comparison_features_locales" ADD CONSTRAINT "pages_blocks_pricing_comparison_features_locales_parent_i_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing_comparison_features"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_comparison_features_values" ADD CONSTRAINT "pages_blocks_pricing_comparison_features_values_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing_comparison_features"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_comparison_features_values_locales" ADD CONSTRAINT "pages_blocks_pricing_comparison_features_values_locales_p_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing_comparison_features_values"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_faq_items" ADD CONSTRAINT "pages_blocks_pricing_faq_items_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_faq_items_locales" ADD CONSTRAINT "pages_blocks_pricing_faq_items_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing_faq_items"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_locales" ADD CONSTRAINT "pages_blocks_pricing_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_plans" ADD CONSTRAINT "pages_blocks_pricing_plans_icon_id_media_id_fk" FOREIGN KEY ("icon_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_plans" ADD CONSTRAINT "pages_blocks_pricing_plans_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_plans_features" ADD CONSTRAINT "pages_blocks_pricing_plans_features_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing_plans"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_plans_features_locales" ADD CONSTRAINT "pages_blocks_pricing_plans_features_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing_plans_features"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_pricing_plans_locales" ADD CONSTRAINT "pages_blocks_pricing_plans_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_pricing_plans"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_stats_block" ADD CONSTRAINT "pages_blocks_stats_block_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_stats_block" ADD CONSTRAINT "pages_blocks_stats_block_style_bg_image_id_media_id_fk" FOREIGN KEY ("style_bg_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_stats_block_locales" ADD CONSTRAINT "pages_blocks_stats_block_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_stats_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_stats_block_stats" ADD CONSTRAINT "pages_blocks_stats_block_stats_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_stats_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_stats_block_stats_locales" ADD CONSTRAINT "pages_blocks_stats_block_stats_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_stats_block_stats"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_tabs" ADD CONSTRAINT "pages_blocks_tabs_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_tabs_locales" ADD CONSTRAINT "pages_blocks_tabs_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_tabs"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_tabs_tabs" ADD CONSTRAINT "pages_blocks_tabs_tabs_custom_icon_id_media_id_fk" FOREIGN KEY ("custom_icon_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_tabs_tabs" ADD CONSTRAINT "pages_blocks_tabs_tabs_img_txt_img_id_media_id_fk" FOREIGN KEY ("img_txt_img_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_tabs_tabs" ADD CONSTRAINT "pages_blocks_tabs_tabs_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_tabs"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_tabs_tabs_features" ADD CONSTRAINT "pages_blocks_tabs_tabs_features_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_tabs_tabs"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_tabs_tabs_features_locales" ADD CONSTRAINT "pages_blocks_tabs_tabs_features_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_tabs_tabs_features"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_tabs_tabs_locales" ADD CONSTRAINT "pages_blocks_tabs_tabs_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_tabs_tabs"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_custom_icon_idx" ON "pages_blocks_accordion_items" USING btree ("custom_icon_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_img_txt_img_txt_img_idx" ON "pages_blocks_accordion_items" USING btree ("img_txt_img_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_list_items_order_idx" ON "pages_blocks_accordion_items_list_items" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_list_items_parent_id_idx" ON "pages_blocks_accordion_items_list_items" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_order_idx" ON "pages_blocks_accordion_items" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_parent_id_idx" ON "pages_blocks_accordion_items" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_table_data_headers_order_idx" ON "pages_blocks_accordion_items_table_data_headers" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_table_data_headers_parent_id_idx" ON "pages_blocks_accordion_items_table_data_headers" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_table_data_rows_cells_order_idx" ON "pages_blocks_accordion_items_table_data_rows_cells" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_table_data_rows_cells_parent_id_idx" ON "pages_blocks_accordion_items_table_data_rows_cells" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_table_data_rows_order_idx" ON "pages_blocks_accordion_items_table_data_rows" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_items_table_data_rows_parent_id_idx" ON "pages_blocks_accordion_items_table_data_rows" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_order_idx" ON "pages_blocks_accordion" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_parent_id_idx" ON "pages_blocks_accordion" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_accordion_path_idx" ON "pages_blocks_accordion" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_before_after_comparisons_after_image_idx" ON "pages_blocks_before_after_comparisons" USING btree ("after_image_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_before_after_comparisons_before_image_idx" ON "pages_blocks_before_after_comparisons" USING btree ("before_image_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_before_after_comparisons_order_idx" ON "pages_blocks_before_after_comparisons" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_before_after_comparisons_parent_id_idx" ON "pages_blocks_before_after_comparisons" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_before_after_order_idx" ON "pages_blocks_before_after" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_before_after_parent_id_idx" ON "pages_blocks_before_after" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_before_after_path_idx" ON "pages_blocks_before_after" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_before_after_items_after_image_idx" ON "pages_blocks_comparison_before_after_items" USING btree ("after_image_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_before_after_items_before_image_idx" ON "pages_blocks_comparison_before_after_items" USING btree ("before_image_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_before_after_items_order_idx" ON "pages_blocks_comparison_before_after_items" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_before_after_items_parent_id_idx" ON "pages_blocks_comparison_before_after_items" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_crd_items_features_order_idx" ON "pages_blocks_comparison_crd_items_features" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_crd_items_features_parent_id_idx" ON "pages_blocks_comparison_crd_items_features" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_crd_items_image_idx" ON "pages_blocks_comparison_crd_items" USING btree ("image_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_crd_items_order_idx" ON "pages_blocks_comparison_crd_items" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_crd_items_parent_id_idx" ON "pages_blocks_comparison_crd_items" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_order_idx" ON "pages_blocks_comparison" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_parent_id_idx" ON "pages_blocks_comparison" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_path_idx" ON "pages_blocks_comparison" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_cons_order_idx" ON "pages_blocks_comparison_pros_cons_items_cons" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_cons_parent_id_idx" ON "pages_blocks_comparison_pros_cons_items_cons" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_image_idx" ON "pages_blocks_comparison_pros_cons_items" USING btree ("image_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_order_idx" ON "pages_blocks_comparison_pros_cons_items" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_parent_id_idx" ON "pages_blocks_comparison_pros_cons_items" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_pros_order_idx" ON "pages_blocks_comparison_pros_cons_items_pros" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_pros_parent_id_idx" ON "pages_blocks_comparison_pros_cons_items_pros" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_columns_image_idx" ON "pages_blocks_comparison_tbl_columns" USING btree ("image_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_columns_order_idx" ON "pages_blocks_comparison_tbl_columns" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_columns_parent_id_idx" ON "pages_blocks_comparison_tbl_columns" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_rows_order_idx" ON "pages_blocks_comparison_tbl_rows" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_rows_parent_id_idx" ON "pages_blocks_comparison_tbl_rows" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_rows_values_order_idx" ON "pages_blocks_comparison_tbl_rows_values" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_rows_values_parent_id_idx" ON "pages_blocks_comparison_tbl_rows_values" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_downloads_block_order_idx" ON "pages_blocks_downloads_block" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_downloads_block_parent_id_idx" ON "pages_blocks_downloads_block" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_downloads_block_path_idx" ON "pages_blocks_downloads_block" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_downloads_block_related_product_idx" ON "pages_blocks_downloads_block" USING btree ("related_product_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_downloads_block_related_service_idx" ON "pages_blocks_downloads_block" USING btree ("related_service_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_events_order_idx" ON "pages_blocks_events" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_events_parent_id_idx" ON "pages_blocks_events" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_events_path_idx" ON "pages_blocks_events" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_jobs_block_location_filter_idx" ON "pages_blocks_jobs_block" USING btree ("location_filter_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_jobs_block_order_idx" ON "pages_blocks_jobs_block" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_jobs_block_parent_id_idx" ON "pages_blocks_jobs_block" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_jobs_block_path_idx" ON "pages_blocks_jobs_block" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_locations_block_order_idx" ON "pages_blocks_locations_block" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_locations_block_parent_id_idx" ON "pages_blocks_locations_block" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_locations_block_path_idx" ON "pages_blocks_locations_block" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_logo_grid_block_logos_logo_idx" ON "pages_blocks_logo_grid_block_logos" USING btree ("logo_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_logo_grid_block_logos_order_idx" ON "pages_blocks_logo_grid_block_logos" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_logo_grid_block_logos_parent_id_idx" ON "pages_blocks_logo_grid_block_logos" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_logo_grid_block_order_idx" ON "pages_blocks_logo_grid_block" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_logo_grid_block_parent_id_idx" ON "pages_blocks_logo_grid_block" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_logo_grid_block_partner_type_order_idx" ON "pages_blocks_logo_grid_block_partner_type" USING btree ("order");
CREATE INDEX IF NOT EXISTS "pages_blocks_logo_grid_block_partner_type_parent_idx" ON "pages_blocks_logo_grid_block_partner_type" USING btree ("parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_logo_grid_block_path_idx" ON "pages_blocks_logo_grid_block" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_map_block_fallback_fallback_static_image_idx" ON "pages_blocks_map_block" USING btree ("fallback_static_image_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_map_block_location_type_order_idx" ON "pages_blocks_map_block_location_type" USING btree ("order");
CREATE INDEX IF NOT EXISTS "pages_blocks_map_block_location_type_parent_idx" ON "pages_blocks_map_block_location_type" USING btree ("parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_map_block_markers_custom_icon_idx" ON "pages_blocks_map_block_markers" USING btree ("custom_icon_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_map_block_markers_order_idx" ON "pages_blocks_map_block_markers" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_map_block_markers_parent_id_idx" ON "pages_blocks_map_block_markers" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_map_block_order_idx" ON "pages_blocks_map_block" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_map_block_parent_id_idx" ON "pages_blocks_map_block" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_map_block_path_idx" ON "pages_blocks_map_block" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_comparison_features_order_idx" ON "pages_blocks_pricing_comparison_features" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_comparison_features_parent_id_idx" ON "pages_blocks_pricing_comparison_features" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_comparison_features_values_order_idx" ON "pages_blocks_pricing_comparison_features_values" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_comparison_features_values_parent_id_idx" ON "pages_blocks_pricing_comparison_features_values" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_faq_items_order_idx" ON "pages_blocks_pricing_faq_items" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_faq_items_parent_id_idx" ON "pages_blocks_pricing_faq_items" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_order_idx" ON "pages_blocks_pricing" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_parent_id_idx" ON "pages_blocks_pricing" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_path_idx" ON "pages_blocks_pricing" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_plans_features_order_idx" ON "pages_blocks_pricing_plans_features" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_plans_features_parent_id_idx" ON "pages_blocks_pricing_plans_features" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_plans_icon_idx" ON "pages_blocks_pricing_plans" USING btree ("icon_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_plans_order_idx" ON "pages_blocks_pricing_plans" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_pricing_plans_parent_id_idx" ON "pages_blocks_pricing_plans" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_stats_block_order_idx" ON "pages_blocks_stats_block" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_stats_block_parent_id_idx" ON "pages_blocks_stats_block" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_stats_block_path_idx" ON "pages_blocks_stats_block" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_stats_block_stats_order_idx" ON "pages_blocks_stats_block_stats" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_stats_block_stats_parent_id_idx" ON "pages_blocks_stats_block_stats" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_stats_block_style_style_bg_image_idx" ON "pages_blocks_stats_block" USING btree ("style_bg_image_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_tabs_order_idx" ON "pages_blocks_tabs" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_tabs_parent_id_idx" ON "pages_blocks_tabs" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_tabs_path_idx" ON "pages_blocks_tabs" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_tabs_tabs_custom_icon_idx" ON "pages_blocks_tabs_tabs" USING btree ("custom_icon_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_tabs_tabs_features_order_idx" ON "pages_blocks_tabs_tabs_features" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_tabs_tabs_features_parent_id_idx" ON "pages_blocks_tabs_tabs_features" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_tabs_tabs_img_txt_img_txt_img_idx" ON "pages_blocks_tabs_tabs" USING btree ("img_txt_img_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_tabs_tabs_order_idx" ON "pages_blocks_tabs_tabs" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_tabs_tabs_parent_id_idx" ON "pages_blocks_tabs_tabs" USING btree ("_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_accordion_items_list_items_locales_locale_paren" ON "pages_blocks_accordion_items_list_items_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_accordion_items_locales_locale_parent_id_unique" ON "pages_blocks_accordion_items_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_accordion_items_table_data_headers_locales_loca" ON "pages_blocks_accordion_items_table_data_headers_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_accordion_items_table_data_rows_cells_locales_l" ON "pages_blocks_accordion_items_table_data_rows_cells_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_accordion_locales_locale_parent_id_unique" ON "pages_blocks_accordion_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_before_after_comparisons_locales_locale_parent_" ON "pages_blocks_before_after_comparisons_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_before_after_locales_locale_parent_id_unique" ON "pages_blocks_before_after_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_before_after_items_locales_locale_pa" ON "pages_blocks_comparison_before_after_items_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_crd_items_features_locales_locale_pa" ON "pages_blocks_comparison_crd_items_features_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_crd_items_locales_locale_parent_id_u" ON "pages_blocks_comparison_crd_items_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_locales_locale_parent_id_unique" ON "pages_blocks_comparison_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_cons_locales_locale_" ON "pages_blocks_comparison_pros_cons_items_cons_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_locales_locale_paren" ON "pages_blocks_comparison_pros_cons_items_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_pros_cons_items_pros_locales_locale_" ON "pages_blocks_comparison_pros_cons_items_pros_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_columns_locales_locale_parent_id" ON "pages_blocks_comparison_tbl_columns_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_rows_locales_locale_parent_id_un" ON "pages_blocks_comparison_tbl_rows_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_comparison_tbl_rows_values_locales_locale_paren" ON "pages_blocks_comparison_tbl_rows_values_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_downloads_block_locales_locale_parent_id_unique" ON "pages_blocks_downloads_block_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_events_locales_locale_parent_id_unique" ON "pages_blocks_events_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_jobs_block_locales_locale_parent_id_unique" ON "pages_blocks_jobs_block_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_locations_block_locales_locale_parent_id_unique" ON "pages_blocks_locations_block_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_logo_grid_block_locales_locale_parent_id_unique" ON "pages_blocks_logo_grid_block_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_map_block_locales_locale_parent_id_unique" ON "pages_blocks_map_block_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_map_block_markers_locales_locale_parent_id_uniq" ON "pages_blocks_map_block_markers_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_pricing_comparison_features_locales_locale_pare" ON "pages_blocks_pricing_comparison_features_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_pricing_comparison_features_values_locales_loca" ON "pages_blocks_pricing_comparison_features_values_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_pricing_faq_items_locales_locale_parent_id_uniq" ON "pages_blocks_pricing_faq_items_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_pricing_locales_locale_parent_id_unique" ON "pages_blocks_pricing_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_pricing_plans_features_locales_locale_parent_id" ON "pages_blocks_pricing_plans_features_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_pricing_plans_locales_locale_parent_id_unique" ON "pages_blocks_pricing_plans_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_stats_block_locales_locale_parent_id_unique" ON "pages_blocks_stats_block_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_stats_block_stats_locales_locale_parent_id_uniq" ON "pages_blocks_stats_block_stats_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_tabs_locales_locale_parent_id_unique" ON "pages_blocks_tabs_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_tabs_tabs_features_locales_locale_parent_id_uni" ON "pages_blocks_tabs_tabs_features_locales" USING btree ("_locale","_parent_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_tabs_tabs_locales_locale_parent_id_unique" ON "pages_blocks_tabs_tabs_locales" USING btree ("_locale","_parent_id");

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_embed_block_video_source" AS ENUM('youtube', 'vimeo', 'custom');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_embed_block_aspect_ratio" AS ENUM('16:9', '4:3', '1:1', '9:16');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_embed_block_max_width" AS ENUM('full', 'large', 'medium', 'small');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_embed_block_style_alignment" AS ENUM('left', 'center', 'right');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  CREATE TYPE "public"."enum_pages_blocks_video_embed_block_style_border_radius" AS ENUM('none', 'sm', 'md', 'lg');
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

CREATE TABLE IF NOT EXISTS "pages_blocks_video_embed_block" (
  "_order" integer NOT NULL,
  "_parent_id" integer NOT NULL,
  "_path" text NOT NULL,
  "id" varchar PRIMARY KEY NOT NULL,
  "video_source" "enum_pages_blocks_video_embed_block_video_source" DEFAULT 'youtube' NOT NULL,
  "youtube_url" varchar,
  "vimeo_url" varchar,
  "custom_url" varchar,
  "thumbnail_id" integer,
  "privacy_mode" boolean DEFAULT true,
  "lazy_load" boolean DEFAULT true,
  "aspect_ratio" "enum_pages_blocks_video_embed_block_aspect_ratio" DEFAULT '16:9',
  "max_width" "enum_pages_blocks_video_embed_block_max_width" DEFAULT 'large',
  "playback_options_autoplay" boolean DEFAULT false,
  "playback_options_muted" boolean DEFAULT false,
  "playback_options_loop" boolean DEFAULT false,
  "playback_options_show_controls" boolean DEFAULT true,
  "playback_options_start_time" numeric,
  "style_alignment" "enum_pages_blocks_video_embed_block_style_alignment" DEFAULT 'center',
  "style_border_radius" "enum_pages_blocks_video_embed_block_style_border_radius" DEFAULT 'md',
  "style_shadow" boolean DEFAULT true,
  "block_name" varchar
);

CREATE TABLE IF NOT EXISTS "pages_blocks_video_embed_block_locales" (
  "title" varchar,
  "caption" varchar,
  "id" serial PRIMARY KEY NOT NULL,
  "_locale" "_locales" NOT NULL,
  "_parent_id" varchar NOT NULL
);

DO $$ BEGIN
  ALTER TABLE "pages_blocks_video_embed_block" ADD CONSTRAINT "pages_blocks_video_embed_block_thumbnail_id_media_id_fk" FOREIGN KEY ("thumbnail_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_video_embed_block" ADD CONSTRAINT "pages_blocks_video_embed_block_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

DO $$ BEGIN
  ALTER TABLE "pages_blocks_video_embed_block_locales" ADD CONSTRAINT "pages_blocks_video_embed_block_locales_parent_id_fk" FOREIGN KEY ("_parent_id") REFERENCES "public"."pages_blocks_video_embed_block"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
  WHEN duplicate_object THEN null;
END $$;

CREATE INDEX IF NOT EXISTS "pages_blocks_video_embed_block_order_idx" ON "pages_blocks_video_embed_block" USING btree ("_order");
CREATE INDEX IF NOT EXISTS "pages_blocks_video_embed_block_parent_id_idx" ON "pages_blocks_video_embed_block" USING btree ("_parent_id");
CREATE INDEX IF NOT EXISTS "pages_blocks_video_embed_block_path_idx" ON "pages_blocks_video_embed_block" USING btree ("_path");
CREATE INDEX IF NOT EXISTS "pages_blocks_video_embed_block_thumbnail_idx" ON "pages_blocks_video_embed_block" USING btree ("thumbnail_id");
CREATE UNIQUE INDEX IF NOT EXISTS "pages_blocks_video_embed_block_locales_locale_parent_id_uniq" ON "pages_blocks_video_embed_block_locales" USING btree ("_locale","_parent_id");
  `)
}

export async function down({ db, payload, req }: MigrateDownArgs): Promise<void> {
  // No-op: data-preserving migration for missing block tables.
}
