Planning Center Calendar Data Model

This document provides complete documentation of the Planning Center Calendar data model in Parable, including all tables, fields, and relationships.

Overview

The Calendar module contains 27 entity tables and 5 relationship tables supporting event management, resource booking, scheduling, and calendar synchronization.

Query Requirements

Schema Prefix

IMPORTANT: All tables in the Planning Center Calendar module are in the planning_center schema. You MUST prefix all table names with planning_center. in your queries. ✅ CORRECT: SELECT * FROM planning_center.calendar_events ❌ INCORRECT: SELECT * FROM calendar_events

Row Level Security (RLS)

This database uses Row Level Security (RLS) to automatically filter data based on:
  • tenant_organization_id: You only see data for your current organization
  • system_status: You only see ‘active’ records by default
DO NOT add these filters to your WHERE clause - they are applied automatically:
  • WHERE tenant_organization_id = 1 (unnecessary)
  • WHERE system_status = 'active' (unnecessary)
The RLS policies ensure you only access data you’re authorized to see, making these filters redundant and potentially causing performance issues.

Core Tables Overview

Primary Entity Tables

  • calendar_events - Master event definitions
  • calendar_event_instances - Specific occurrences of events
  • calendar_resources - Bookable resources (rooms, equipment)
  • calendar_resource_bookings - Resource reservations
  • calendar_conflicts - Scheduling conflicts
  • calendar_tags - Event categorization
  • calendar_tag_groups - Tag groupings

Supporting Entity Tables

  • calendar_attachments - File attachments for events
  • calendar_event_connections - Links to other PCO modules
  • calendar_event_resource_requests - Resource booking requests
  • calendar_event_resource_answers - Answers to booking questions
  • calendar_event_times - Time blocks within events
  • calendar_feeds - Calendar feed configurations
  • calendar_organizations - Organization settings
  • calendar_people - People associated with events
  • calendar_report_templates - Report templates
  • calendar_required_approvals - Approval requirements
  • calendar_resource_approval_groups - Approval groups
  • calendar_resource_folders - Resource organization
  • calendar_resource_questions - Booking questions
  • calendar_resource_suggestions - Suggested resources
  • calendar_room_setups - Room configurations

Relationship Tables

  • calendar_events_relationships - Links events to related entities
  • calendar_event_instances_relationships - Links instances to related entities
  • calendar_resources_relationships - Links resources to related entities
  • calendar_resource_bookings_relationships - Links bookings to related entities
  • calendar_event_resource_requests_relationships - Links requests to related entities

Table Definitions

calendar_events

Master event definitions containing the core event information.
ColumnTypeDescription
idUUIDInternal unique identifier
event_idVARCHAR(64)Planning Center event ID
approval_statusVARCHAR(1)Status: ‘A’ (Approved), ‘P’ (Pending), ‘R’ (Rejected), NULL (No approval needed)
created_atTIMESTAMPWhen event was created
descriptionTEXTFull event description
featuredBOOLEANWhether event is featured/highlighted
image_urlVARCHAR(2048)Event image URL
nameTEXTEvent name/title
percent_approvedINTEGERPercentage of approvals received
percent_rejectedINTEGERPercentage of rejections received
registration_urlVARCHAR(2048)External registration link
summaryTEXTBrief event summary
updated_atTIMESTAMPLast update time
visible_in_church_centerBOOLEANPublic visibility flag
owner_idVARCHAR(64)Event owner/creator ID
feed_idVARCHAR(64)Associated calendar feed
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status: ‘active’, ‘transferring’, ‘stale’
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_event_instances

Specific occurrences of events, handling both one-time and recurring events.
ColumnTypeDescription
idUUIDInternal unique identifier
event_instance_idVARCHAR(64)Planning Center instance ID
all_day_eventBOOLEANWhether this is an all-day event
church_center_urlVARCHAR(2048)Public URL for this instance
compact_recurrence_descriptionTEXTShort recurrence description
created_atTIMESTAMPInstance creation time
ends_atTIMESTAMPEvent end time
locationTEXTEvent location/venue
published_ends_atTIMESTAMPPublished end time (may differ from actual)
published_starts_atTIMESTAMPPublished start time
recurrenceTEXTRecurrence rule (iCal RRULE format)
recurrence_descriptionTEXTHuman-readable recurrence
starts_atTIMESTAMPEvent start time
updated_atTIMESTAMPLast update time
event_idVARCHAR(64)Parent event ID
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_resources

Bookable resources including rooms, equipment, and other facilities.
ColumnTypeDescription
idUUIDInternal unique identifier
resource_idVARCHAR(64)Planning Center resource ID
created_atTIMESTAMPResource creation time
descriptionTEXTResource description
expires_atTIMESTAMPExpiration date (for leased/rented items)
home_locationTEXTDefault storage location
image_urlVARCHAR(2048)Resource image
image_thumb_urlVARCHAR(2048)Thumbnail image
kindTEXTResource type: ‘Room’, ‘Equipment’, ‘Resource’
nameTEXTResource name
path_nameTEXTHierarchical path (Building/Floor/Room)
quantityINTEGERAvailable quantity/capacity
serial_numberTEXTSerial number (for equipment)
updated_atTIMESTAMPLast update time
resource_folderVARCHAR(64)Parent folder ID
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_resource_bookings

Reservations linking resources to specific events and times.
ColumnTypeDescription
idUUIDInternal unique identifier
resource_booking_idVARCHAR(64)Planning Center booking ID
created_atTIMESTAMPBooking creation time
ends_atTIMESTAMPBooking end time
quantityINTEGERQuantity booked
starts_atTIMESTAMPBooking start time
updated_atTIMESTAMPLast update time
event_idVARCHAR(64)Associated event (direct reference for performance)
event_instance_idVARCHAR(64)Associated event instance (direct reference)
event_resource_request_idVARCHAR(64)Original request ID (direct reference)
resource_idVARCHAR(64)Booked resource (direct reference)
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_conflicts

Detected scheduling conflicts between events or resources.
ColumnTypeDescription
idUUIDInternal unique identifier
conflict_idVARCHAR(64)Planning Center conflict ID
created_atTIMESTAMPWhen conflict was detected
resolved_atTIMESTAMPWhen conflict was resolved
noteTEXTConflict notes/resolution
resource_booking_idVARCHAR(64)First booking in conflict
conflicting_resource_booking_idVARCHAR(64)Second booking in conflict
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_tags

Event categorization labels for organizing and filtering.
ColumnTypeDescription
idUUIDInternal unique identifier
tag_idVARCHAR(64)Planning Center tag ID
created_atTIMESTAMPTag creation time
nameTEXTTag name
positionINTEGERDisplay order
updated_atTIMESTAMPLast update time
tag_group_idVARCHAR(64)Parent tag group
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_tag_groups

Groupings for tags to organize them by ministry, event type, etc.
ColumnTypeDescription
idUUIDInternal unique identifier
tag_group_idVARCHAR(64)Planning Center tag group ID
created_atTIMESTAMPGroup creation time
nameTEXTGroup name
updated_atTIMESTAMPLast update time
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_attachments

File attachments associated with events.
ColumnTypeDescription
idUUIDInternal unique identifier
attachment_idVARCHAR(64)Planning Center attachment ID
content_typeTEXTMIME type of file
created_atTIMESTAMPAttachment creation time
descriptionTEXTAttachment description
file_sizeINTEGERFile size in bytes
nameTEXTFile name
updated_atTIMESTAMPLast update time
urlTEXTDownload URL
event_idVARCHAR(64)Associated event
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_event_connections

Links between calendar events and other Planning Center modules.
ColumnTypeDescription
idUUIDInternal unique identifier
event_connection_idVARCHAR(64)Planning Center connection ID
connected_to_idVARCHAR(64)ID of connected entity
connected_to_nameTEXTName of connected entity
connected_to_typeVARCHAR(50)Type of connected entity
connected_to_urlVARCHAR(2048)URL to connected entity
product_nameVARCHAR(50)PCO product (services, groups, etc.)
event_idVARCHAR(64)Associated event
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_event_times

Specific time blocks within event instances (e.g., “Doors Open”, “Main Service”).
ColumnTypeDescription
idUUIDInternal unique identifier
event_time_idVARCHAR(64)Planning Center event time ID
ends_atTIMESTAMPTime block end
nameTEXTTime block name
starts_atTIMESTAMPTime block start
visible_on_kiosksBOOLEANShow on check-in kiosks
visible_on_widget_and_icalBOOLEANShow in public widgets/calendars
event_idVARCHAR(64)Associated event
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_room_setups

Predefined room configurations with layout diagrams.
ColumnTypeDescription
idUUIDInternal unique identifier
room_setup_idVARCHAR(64)Planning Center setup ID
created_atTIMESTAMPSetup creation time
descriptionTEXTSetup description
diagram_thumbnail_urlVARCHAR(2048)Diagram thumbnail
diagram_urlVARCHAR(2048)Setup diagram image
nameTEXTSetup name
updated_atTIMESTAMPLast update time
associated_room_setup_idVARCHAR(64)Associated room setup (for variants)
containing_resource_idVARCHAR(64)Room resource containing this setup
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_event_resource_requests

Resource requests for events, tracking booking requirements.
ColumnTypeDescription
idUUIDInternal unique identifier
event_resource_request_idVARCHAR(64)Planning Center request ID
approval_sentBOOLEANWhether approval request was sent
approval_statusVARCHAR(50)Approval status
created_atTIMESTAMPRequest creation time
noteTEXTRequest notes
quantityINTEGERQuantity requested
room_setup_idVARCHAR(64)Requested room setup
updated_atTIMESTAMPLast update time
created_by_idVARCHAR(64)Person who created request
event_idVARCHAR(64)Associated event
resource_idVARCHAR(64)Requested resource
updated_by_idVARCHAR(64)Person who last updated
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_event_resource_answers

Answers to resource booking questions.
ColumnTypeDescription
idUUIDInternal unique identifier
event_resource_answer_idVARCHAR(64)Planning Center answer ID
created_atTIMESTAMPAnswer creation time
updated_atTIMESTAMPLast update time
created_by_idVARCHAR(64)Person who created answer
updated_by_idVARCHAR(64)Person who last updated
resource_question_idVARCHAR(64)Associated question
event_resource_request_idVARCHAR(64)Associated request
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_feeds

Calendar feed configurations for importing and syncing events.
ColumnTypeDescription
idUUIDInternal unique identifier
feed_idVARCHAR(64)Planning Center feed ID
can_deleteBOOLEANWhether feed can be deleted
default_church_center_visibilityVARCHAR(50)Default visibility for imported events
feed_typeVARCHAR(50)Type of feed (ical, planning_center)
imported_atTIMESTAMPLast import time
nameTEXTFeed name
source_idVARCHAR(64)Source identifier
event_owner_idVARCHAR(64)Default owner for imported events
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_organizations

Organization-wide calendar settings.
ColumnTypeDescription
idUUIDInternal unique identifier
organization_idVARCHAR(64)Planning Center organization ID
date_formatVARCHAR(255)Date display format
nameTEXTOrganization name
time_zoneVARCHAR(255)Default timezone
twenty_four_hour_timeBOOLEANUse 24-hour time format
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_people

People with calendar permissions and access.
ColumnTypeDescription
idUUIDInternal unique identifier
person_idVARCHAR(64)Planning Center person ID
avatar_urlVARCHAR(2048)Profile image URL
can_edit_peopleBOOLEANCan edit people permissions
can_edit_resourcesBOOLEANCan edit resources
can_edit_roomsBOOLEANCan edit rooms
childBOOLEANIs a child account
created_atTIMESTAMPPerson creation time
event_permissions_typeVARCHAR(50)Event permission level
first_nameVARCHAR(255)First name
genderVARCHAR(10)Gender
has_accessBOOLEANHas calendar access
last_nameVARCHAR(255)Last name
middle_nameVARCHAR(255)Middle name
nameVARCHAR(255)Full name
name_prefixVARCHAR(10)Name prefix (Mr., Dr., etc.)
name_suffixVARCHAR(10)Name suffix (Jr., III, etc.)
pending_request_countINTEGERNumber of pending approval requests
people_permissions_typeTEXTPeople permission level
permissionsINTEGERPermission bitmask
resolves_conflictsBOOLEANCan resolve booking conflicts
resources_permissions_typeTEXTResource permission level
room_permissions_typeTEXTRoom permission level
site_administratorBOOLEANIs site administrator
statusTEXTAccount status
updated_atTIMESTAMPLast update time
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_report_templates

Report templates for calendar data.
ColumnTypeDescription
idUUIDInternal unique identifier
report_template_idVARCHAR(64)Planning Center template ID
bodyTEXTTemplate body/content
created_atTIMESTAMPTemplate creation time
descriptionTEXTTemplate description
titleTEXTTemplate title
updated_atTIMESTAMPLast update time
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_required_approvals

Approval requirements for resource bookings.
ColumnTypeDescription
idUUIDInternal unique identifier
required_approval_idVARCHAR(64)Planning Center approval ID
resource_approval_group_idVARCHAR(64)Approval group responsible
resource_idVARCHAR(64)Resource requiring approval
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_resource_approval_groups

Groups responsible for approving resource bookings.
ColumnTypeDescription
idUUIDInternal unique identifier
resource_approval_group_idVARCHAR(64)Planning Center group ID
created_atTIMESTAMPGroup creation time
nameTEXTGroup name
updated_atTIMESTAMPLast update time
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_resource_folders

Hierarchical organization of resources.
ColumnTypeDescription
idUUIDInternal unique identifier
resource_folder_idVARCHAR(64)Planning Center folder ID
ancestryTEXTHierarchical path (parent/child/grandchild)
created_atTIMESTAMPFolder creation time
kindTEXTFolder type
nameTEXTFolder name
path_nameTEXTFull path name
updated_atTIMESTAMPLast update time
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_resource_questions

Booking questions for specific resources.
ColumnTypeDescription
idUUIDInternal unique identifier
resource_question_idVARCHAR(64)Planning Center question ID
choicesTEXTAvailable choices (for select fields)
created_atTIMESTAMPQuestion creation time
descriptionTEXTQuestion description/help text
kindTEXTQuestion type (text, select, etc.)
multiple_selectBOOLEANAllow multiple selections
optionalBOOLEANIs answer optional
positionINTEGERDisplay order
questionTEXTQuestion text
updated_atTIMESTAMPLast update time
resource_idVARCHAR(64)Associated resource
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

calendar_resource_suggestions

Suggested resources for room setups.
ColumnTypeDescription
idUUIDInternal unique identifier
resource_suggestion_idVARCHAR(64)Planning Center suggestion ID
created_atTIMESTAMPSuggestion creation time
quantityINTEGERSuggested quantity
updated_atTIMESTAMPLast update time
resource_idVARCHAR(64)Suggested resource
room_setup_idVARCHAR(64)Associated room setup
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable

Relationship Tables

calendar_event_resource_requests_relationships

Links resource requests to answers and bookings.
ColumnTypeDescription
idUUIDInternal unique identifier
event_resource_request_idVARCHAR(64)Parent request ID
relationship_typeVARCHAR(50)Type of relationship
relationship_idVARCHAR(64)ID of related entity
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable
Common relationship types:
  • ResourceBooking - Links to calendar_resource_bookings
  • EventResourceAnswer - Links to calendar_event_resource_answers

calendar_events_relationships

Links events to tags, attachments, and other related entities.
ColumnTypeDescription
idUUIDInternal unique identifier
event_idVARCHAR(64)Parent event ID
relationship_typeVARCHAR(50)Type of relationship
relationship_idVARCHAR(64)ID of related entity
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable
Common relationship types:
  • Tag - Links to calendar_tags
  • Attachment - Links to calendar_attachments
  • Owner - Links to calendar_people

calendar_event_instances_relationships

Links event instances to event times, resource bookings, and tags.
ColumnTypeDescription
idUUIDInternal unique identifier
event_instance_idVARCHAR(64)Parent instance ID
relationship_typeVARCHAR(50)Type of relationship
relationship_idVARCHAR(64)ID of related entity
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable
Common relationship types:
  • EventTime - Links to calendar_event_times
  • ResourceBooking - Links to calendar_resource_bookings
  • Tag - Links to calendar_tags

calendar_resources_relationships

Links resources to approval groups, questions, and room setups.
ColumnTypeDescription
idUUIDInternal unique identifier
resource_idVARCHAR(64)Parent resource ID
relationship_typeVARCHAR(50)Type of relationship
relationship_idVARCHAR(64)ID of related entity
tenant_organization_idINTEGEROrganization identifier
system_statusVARCHAR(50)Data status
system_created_atTIMESTAMPWhen record was created in Parable
system_updated_atTIMESTAMPWhen record was last updated in Parable
Common relationship types:
  • ResourceApprovalGroup - Links to calendar_resource_approval_groups
  • ResourceQuestion - Links to calendar_resource_questions
  • RoomSetup - Links to calendar_room_setups

System Fields

All tables include these system fields for data management:
  • tenant_organization_id - Multi-tenant organization identifier
  • system_status - Data lifecycle status:
    • transferring - Being imported from Planning Center
    • active - Current active data
    • stale - Marked for removal
  • system_created_at - When record was created in Parable
  • system_updated_at - When record was last updated in Parable

Common Query Patterns

Getting Events with Tags

-- CORRECT: Schema prefix included, no manual RLS filters
SELECT
    e.*,
    STRING_AGG(t.name, ', ') as tags
FROM planning_center.calendar_events e
LEFT JOIN planning_center.calendar_events_relationships er
    ON e.event_id = er.event_id
    AND er.relationship_type = 'Tag'
LEFT JOIN planning_center.calendar_tags t
    ON er.relationship_id = t.tag_id
GROUP BY e.id, e.event_id;

Finding Available Resources

SELECT r.*
FROM planning_center.calendar_resources r
WHERE NOT EXISTS (
        SELECT 1
        FROM planning_center.calendar_resource_bookings rb
        WHERE rb.resource_id = r.resource_id
            AND rb.starts_at < '2024-01-15 14:00:00'
            AND rb.ends_at > '2024-01-15 12:00:00'
    );

Detecting Booking Conflicts

SELECT
    rb1.resource_booking_id as booking1,
    rb2.resource_booking_id as booking2,
    r.name as resource_name
FROM planning_center.calendar_resource_bookings rb1
JOIN planning_center.calendar_resource_bookings rb2
    ON rb1.resource_id = rb2.resource_id
    AND rb1.resource_booking_id < rb2.resource_booking_id
    AND rb1.starts_at < rb2.ends_at
    AND rb1.ends_at > rb2.starts_at
JOIN planning_center.calendar_resources r
    ON rb1.resource_id = r.resource_id
;

Today’s Schedule

SELECT
    e.name as event_name,
    ei.starts_at,
    ei.ends_at,
    ei.location
FROM planning_center.calendar_events e
JOIN planning_center.calendar_event_instances ei
    ON e.event_id = ei.event_id
    AND (
        DATE(ei.starts_at) = CURRENT_DATE
        OR (ei.all_day_event = true
            AND DATE(ei.starts_at) <= CURRENT_DATE
            AND DATE(ei.ends_at) >= CURRENT_DATE)
    )
ORDER BY ei.starts_at;

Data Integrity Rules

  1. Schema Qualification: Always use planning_center. prefix for all table references
  2. Row Level Security: RLS automatically handles multi-tenancy and status filtering - do not add manual filters
  3. Monetary Values: Resource fee and cost columns are stored in cents - divide by 100.0 for display
  4. Time Windows: Use starts_at/ends_at comparisons and the all_day_event flag rather than relying on system_status
  5. Direct ID Columns: calendar_resource_bookings and related tables expose direct IDs for performance-sensitive joins

Common Mistakes to Avoid

  1. Missing Schema Prefix
    • FROM calendar_events
    • FROM planning_center.calendar_events
  2. Adding Redundant RLS Filters
    • WHERE tenant_organization_id = 1 AND system_status = 'active'
    • ✅ Trust RLS to handle this automatically
  3. Joining Without Schema
    • JOIN calendar_resource_bookings rb ON ...
    • JOIN planning_center.calendar_resource_bookings rb ON ...
  4. Misreporting Fees
    • SELECT resource_fee_cents as resource_fee
    • SELECT resource_fee_cents / 100.0 as resource_fee

Performance Considerations

  1. Indexes: All tables have optimized indexes on:
    • Primary keys and entity IDs
    • Join columns and foreign keys
    • Date columns for time-based queries
  2. Query Optimization:
    • Always use the planning_center. schema prefix
    • RLS handles tenant and status filtering automatically
    • Filter by approval or conflict flags when relevant
    • Consider CTEs for complex hierarchical queries
    • Use direct ID columns when available instead of relationship tables

Data Types and Conventions

Approval Statuses

  • A - Approved
  • P - Pending approval
  • R - Rejected
  • NULL - No approval required

Resource Types (kind)

  • Room - Physical spaces
  • Equipment - Movable items
  • Resource - Other bookable items

All-Day Events

  • all_day_event = true indicates full-day events
  • Check date portions of starts_at and ends_at
  • May span multiple days

Recurrence Patterns

  • Stored in iCal RRULE format in recurrence field
  • Human-readable in recurrence_description
  • Each occurrence is a separate event_instance

Next Steps