Skip to main content

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 22 entity tables and 7 relationship tables supporting event management, resource booking, scheduling, and calendar synchronization.

Visual Data Model

The diagram below shows the core entities and their relationships in the Calendar module. Use it as a visual reference while exploring the detailed table definitions below.

Core Entity Relationships

Calendar module data model
Open diagram in new tab →

Key Relationships Explained

Event Hierarchy:
  • EVENT is the master event (e.g., “Sunday Service”)
  • EVENT_INSTANCE is a specific occurrence (e.g., “Sunday Service on Jan 15, 2024”)
  • EVENT_TIME breaks instances into periods (Setup 8am-9am, Event 9am-11am, Teardown 11am-12pm)
Resource Booking:
  • RESOURCEs are bookable items (rooms, equipment, vehicles)
  • RESOURCE_FOLDERs organize resources hierarchically
  • RESOURCE_BOOKING links resources to event instances
  • ROOM_SETUP defines different configurations for room resources
Approval Workflow:
  • EVENT_RESOURCE_REQUEST initiates booking request
  • REQUIRED_APPROVAL specifies which groups must approve
  • RESOURCE_APPROVAL_GROUP contains approvers
  • RESOURCE_QUESTION collects additional information during booking
Conflict Management:
  • CONFLICT tracks resource double-bookings
  • Links winner (approved booking) and loser (rejected booking)
  • Resolved when winner is selected
Cross-App Connections:
  • EVENT_CONNECTION links calendar events to other Planning Center modules
  • Connected to Services (worship plans), Groups (group events), etc.
  • Enables unified scheduling across the platform
Generic Relationship Pattern:
  • Event metadata via calendar_events_relationships

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_event_resource_answer_relationships - Links answers to related entities
  • calendar_eventinstances_relationships - Links instances to related entities
  • calendar_eventresourcerequests_relationships - Links requests to related entities
  • calendar_events_relationships - Links events to related entities
  • calendar_resourcebookings_relationships - Links bookings to related entities
  • calendar_resources_relationships - Links resources to related entities
  • calendar_tag_groups_relationships - Links tag groups to related entities

Table Definitions

calendar_events

Master event definitions containing the core event information.

calendar_event_instances

Specific occurrences of events, handling both one-time and recurring events.

calendar_resources

Bookable resources including rooms, equipment, and other facilities.

calendar_resource_bookings

Reservations linking resources to specific events and times.

calendar_conflicts

Detected scheduling conflicts between events or resources.

calendar_tags

Event categorization labels for organizing and filtering.

calendar_tag_groups

Groupings for tags to organize them by ministry, event type, etc.

calendar_attachments

File attachments associated with events.

calendar_event_connections

Links between calendar events and other Planning Center modules.

calendar_event_times

Specific time blocks within event instances (e.g., “Doors Open”, “Main Service”).

calendar_room_setups

Predefined room configurations with layout diagrams.

calendar_event_resource_requests

Resource requests for events, tracking booking requirements.

calendar_event_resource_answers

Answers to resource booking questions. Note: Relationships (created_by, updated_by, resource_question, event_resource_request) are stored in the calendar_event_resource_answer_relationships table following the golden rule pattern.

calendar_feeds

Calendar feed configurations for importing and syncing events.

calendar_organizations

Organization-wide calendar settings.

calendar_people

People with calendar permissions and access.

calendar_report_templates

Report templates for calendar data.

calendar_required_approvals

Approval requirements for resource bookings.

calendar_resource_approval_groups

Groups responsible for approving resource bookings.

calendar_resource_folders

Hierarchical organization of resources.

calendar_resource_questions

Booking questions for specific resources.

calendar_resource_suggestions

Suggested resources for room setups.

Relationship Tables

calendar_event_resource_answer_relationships

Links event resource answers to related entities (created_by, updated_by, resource_question, event_resource_request). Common relationship types:
  • Person (created_by) - Links to calendar_people (who created the answer)
  • Person (updated_by) - Links to calendar_people (who last updated the answer)
  • ResourceQuestion - Links to calendar_resource_questions
  • EventResourceRequest - Links to calendar_event_resource_requests

calendar_eventresourcerequests_relationships

Links resource requests to answers and bookings. 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. Common relationship types:
  • Tag - Links to calendar_tags
  • Attachment - Links to calendar_attachments
  • Owner - Links to calendar_people

calendar_eventinstances_relationships

Links event instances to event times, resource bookings, and tags. 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. 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

Finding Available Resources

Detecting Booking Conflicts

Today’s Schedule

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