You do not need direct SQL to work with BricksMembers. Use the public API and let the plugin handle caching, normalization, and rebuild logic.
Data Concepts
- User levels live in
brm_user_level_assignments - Post requirements live in
brm_post_level_requirements - Direct completions live in
brm_user_post_completions - Structure/access projection lives in
brm_post_data - Aggregate progress lives in
brm_user_progress
Read Through the API
$levels = brm_get_user_levels( $user_id );
$required_levels = brm_get_post_required_levels( $post_id );
$completed = \BaselMedia\BricksMembers\Modules\Progress\ProgressCompletionReadService::get_instance()->get_completed_post_ids_for_user( $user_id );
$post_data = \BaselMedia\BricksMembers\Services\PostDataService::get_instance()->get_post_data( $post_id );
Write Through the API
brm_add_user_level( $user_id, $level_id );
brm_remove_user_level( $user_id, $level_id );
brm_set_post_levels( $post_id, [ 1, 2 ] );
brm_mark_content_completed( $user_id, $post_id );
Do not write required_levels into brm_post_data. In 0.9.82+, that is no longer canonical storage.
Query Performance Schema Flags
Schema services may add non-destructive performance columns and indexes after the base tables already exist. These upgrades are idempotent and versioned by module-specific options so normal frontend requests can avoid strict metadata checks once the tables are known.
brm_events_query_perf_schema_version— event details/registration composite indexes for calendar, target, and viewer registration reads.brm_billing_query_perf_schema_version— billingoffer_keyandis_demoquery columns plus payment/subscription/event indexes.brm_billing_payment_offer_key_backfill_state— background cursor state for copying legacy one-time paymentdata_json.offer_keyinto the indexed payment column.brm_billing_tax_tables_version— tax table version and query-index repair owner.brm_automation_schema_version— automation table schema version, currently including queue indexes for available, heartbeat, and failed-job reads.brm_chat_query_perf_schema_version— chatlast_activity_atcolumn and room-list indexes.
Do not introduce generated JSON columns or make JSON payloads the canonical query truth for these hot paths. JSON may remain as compatibility payload, but runtime filters should move toward indexed scalar columns owned by the module schema service.