Skip to main content
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 20 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 are stored via calendar_conflicts_relationships
  • 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:
  • All inter-entity links are stored in dedicated *_relationships tables
  • Each relationship table holds a parent entity ID, relationship_type, and relationship_id

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_attachments_relationships - Links attachments to related entities
  • calendar_conflicts_relationships - Links conflicts to related entities
  • calendar_event_connections_relationships - Links connections to related entities
  • calendar_event_resource_answers_relationships - Links answers to related entities
  • calendar_event_times_relationships - Links event times to related entities
  • calendar_event_instances_relationships - Links instances to related entities
  • calendar_event_resource_requests_relationships - Links requests to related entities
  • calendar_events_relationships - Links events to related entities
  • calendar_feeds_relationships - Links feeds to related entities
  • calendar_people_relationships - Links people to related entities
  • calendar_required_approvals_relationships - Links required approvals to related entities
  • calendar_resource_approval_groups_relationships - Links approval groups to related entities
  • calendar_resource_folders_relationships - Links folders to related entities
  • calendar_resource_questions_relationships - Links questions to related entities
  • calendar_resource_suggestions_relationships - Links suggestions to related entities
  • calendar_resource_bookings_relationships - Links bookings to related entities
  • calendar_resources_relationships - Links resources to related entities
  • calendar_room_setups_relationships - Links room setups to related entities
  • calendar_tag_groups_relationships - Links tag groups to related entities
  • calendar_tags_relationships - Links tags 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_answers_relationships table.

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

All relationship tables share this structure: a parent entity ID, relationship_type (VARCHAR(50)), and relationship_id (VARCHAR(64)) to identify the related record, plus standard system fields.

calendar_attachments_relationships

Links attachments to related entities (events).

calendar_conflicts_relationships

Links conflicts to related entities (resource bookings).

calendar_event_connections_relationships

Links event connections to related entities (events).

calendar_event_resource_answers_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_event_times_relationships

Links event times to related entities (event instances).

calendar_event_instances_relationships

Links event instances to event times, resource bookings, and tags. Common relationship types:
  • Event - Links to calendar_events
  • EventTime - Links to calendar_event_times
  • ResourceBooking - Links to calendar_resource_bookings
  • Tag - Links to calendar_tags

calendar_event_resource_requests_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_feeds_relationships

Links feeds to related entities (event owners).

calendar_people_relationships

Links people to related entities.

calendar_required_approvals_relationships

Links required approvals to related entities (approval groups, resources).

calendar_resource_approval_groups_relationships

Links approval groups to related entities (people, resources).

calendar_resource_folders_relationships

Links resource folders to related entities.

calendar_resource_questions_relationships

Links resource questions to related entities (resources).

calendar_resource_suggestions_relationships

Links resource suggestions to related entities (resources, room setups).

calendar_resource_bookings_relationships

Links resource bookings to related entities (events, instances, requests, resources). Common relationship types:
  • Event - Links to calendar_events
  • EventInstance - Links to calendar_event_instances
  • EventResourceRequest - Links to calendar_event_resource_requests
  • Resource - Links to calendar_resources

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

calendar_room_setups_relationships

Links room setups to related entities (containing resource, associated room setup).

calendar_tag_groups_relationships

Links tag groups to related entities.

calendar_tags_relationships

Links tags to related entities (tag groups).

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. Relationship Tables: All inter-entity links are stored in *_relationships tables — never in direct columns on the entity tables

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. Using the wrong parent column in relationship tables
    • WHERE event_resource_request_id = ... in calendar_event_resource_requests_relationships
    • WHERE event_resource_request_id = ... (the live column is event_resource_request_id)
  5. Using the wrong parent column in eventinstances relationship table
    • WHERE event_instance_id = ... in calendar_event_instances_relationships
    • WHERE event_instance_id = ... (the live column is event_instance_id)

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 relationship tables for all cross-entity joins

Data Types and Conventions

Approval Statuses

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

Resource Types (kind)

  • Room - Physical spaces
  • Resource - Other bookable items (equipment, etc.)

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

  • recurrence holds a single keyword, not an iCal RRULE: 'None', 'Daily', 'Weekly', 'Monthly', 'Yearly', 'CustomDates', 'YearMonth', or 'MonthDay'. It is never NULL — filter with recurrence <> 'None' to select recurring events
  • Human-readable detail (days, times, start and end dates) is in recurrence_description, also never NULL
  • Each occurrence is a separate event_instance

Next Steps