Tables


SchemaSpy Analysis of Magicline Enterprise Data Warehouse

Generated on Sun Mar 15 03:35 GMT 2026

XML Representation
Insertion Order Deletion Order
TABLES 23
VIEWS 0
COLUMNS 189
Constraints 0

Database Properties

Database Type: Redshift - 8.0.2

Schema preview

Preview Magicline Enterprise Data Warehouse

These are the docs for the Real-Time [preview] Data Warehouse schema. To see the docs for the current stable schema, please refer to the Real-Time [Current] schema docs.

This read-only schema provides a view to see and validate upcoming changes to the Magicline Data Warehouse schema before they are released to production. It contains new tables, columns or other changes that are not yet part of the stable schema.

Tables

Table / View Children Parents Columns Type Comments
dim_rate_bundle 5 0 7 Table

Rate bundle (offer) header that defines which contract package can be sold and the contract timing rules tied to it.

dim_discount_campaign 6 0 7 Table

A discount campaign is a time-bound promotional discount configuration that studio administrators define and activate per studio. When active, it automatically applies a discount to contracts signed via the configured allowed sales channels (origin types). A campaign defines its validity window (active_from / active_to), how it interacts with discount vouchers (voucher_interoperability_mode), and which rate bundles / flat fees / modules it applies to.

dim_device 0 0 6 Table

A device connected to the system, which enables registering customers using certain areas (the whole gym, the gym sauna) or machines (eg a massage bed) of a gym.

dim_discount_campaign_localized 0 1 6 Table

Localized public names and descriptions for discount campaigns, one row per campaign per locale. Used to display campaign information in the member’s preferred language (e.g. in the MySports app or online checkout). Follows the same pattern as dim_rate_localized and dim_cancellation_reason_localized.

dim_discount_campaign_discount_period 0 2 13 Table

Defines the discount amounts and effective periods for discount campaigns. Covers all three campaign scope types — main contract rate bundle (RATE_BUNDLE), flat-fee bundle (FLAT_FEE), and optional add-on module (MODULE) — in a single table.

Each row represents one discount tier (position) for one campaign scope entry. Multiple tiers per scope entry are possible (e.g. position 0: 100% off for 3 months, position 1: 50% off for the following 3 months).

Join to dim_discount_campaign_scope on discount_campaign_scope_id to determine which rate bundles or terms the discount applies to.

dim_rate_term_payment_frequency_age_based_adjustment 0 0 7 Table

Age-based price adjustments for payment frequencies.

dim_rate_bundle_term 3 1 9 Table

Payment-term options for a rate bundle, such as monthly or term-based variants, including the payment frequency used to charge customers.

dim_rate_term_payment_frequency_month_days 0 0 5 Table

Payment frequency pricing that varies by specific days of the month.

bridge_discount_campaign_to_allowed_origin_type 0 1 4 Table

Maps discount campaigns to their allowed sales channel origin types. One row per (campaign, origin_type) pair. Only origin types listed here are permitted to trigger the campaign discount when a contract is signed.

If a contract is created via a channel not present in this table for the active campaign, the campaign discount is not applied.

dim_rate_term_payment_frequency 0 0 10 Table

Payment frequency options available for rate terms, including price, cadence, and calculation settings.

fct_rate_bundle_price 0 1 17 Table

Reporting-ready bundle prices with a default organization unit row, age bands (defaulting to 0-199), and optional term or month-day windows. final_price already applies organization unit and age adjustments.

bridge_discount_campaign_to_organization_unit 0 1 4 Table

Maps studios (organization units) to their currently registered discount campaigns. A studio can have multiple campaigns registered simultaneously, provided their active_from / active_to validity windows do not overlap (enforced at application level). Join with dim_discount_campaign and filter on the campaign’s validity window to determine which campaign is effective at a given point in time.

Important limitation: This is a point-in-time snapshot. When a studio deactivates a discount campaign, the corresponding row is hard-deleted — no historical record is preserved.

dim_rate_term_configuration 1 0 20 Table

Configuration of contract terms, extensions, cancellations and idle periods for a rate. This table details the rules governing the lifecycle of a contract associated with a specific rate, including initial duration, renewal policies, cancellation notice periods, and allowances for pausing the contract (idle periods).

dim_rate_term_payment_frequency_adjustment 0 0 5 Table

Price adjustments for payment frequencies, optionally scoped to a specific organization unit.

dim_date 0 0 16 Table

Date dimension covering years 1900-2099

dim_contract_payment_frequency 0 0 7 Table

Defines how often and how much is paid for an individual contract.

dim_campaign 0 0 7 Table

Campaign dimension

dim_discount_campaign_rate_bundle_scope 0 3 9 Table

Unified dimension defining which rate bundles (and optionally which specific terms) are in scope for each discount campaign, across all three restriction types (RATE_BUNDLE, FLAT_FEE, MODULE). One row per restriction entry. The restriction_type column disambiguates which price component is scoped.

A NULL rate_bundle_id means the campaign applies to all rate bundles of that type. A NULL rate_bundle_term_id means the campaign applies to all terms of the rate bundle (only valid when rate_bundle_id is also set).

Use this table to answer: “Which rate bundles have a discount campaign set on them?” and “Does this campaign apply to all bundles or specific ones?”

Join with dim_discount_campaign_discount_period on restriction_id + restriction_type to get the actual discount amounts for each scoped restriction.

dim_discount_campaign_scope 1 3 8 Table

Defines which rate bundles (and optionally which specific terms) are in scope for each discount campaign, across all three price component types: RATE_BUNDLE (main contract), FLAT_FEE (flat-fee bundle), and MODULE (optional add-on). One row per scope entry.

A NULL rate_bundle_id means the campaign applies to all rate bundles of that type. A NULL rate_bundle_term_id means the campaign applies to all terms of the rate bundle (only meaningful when rate_bundle_id is also set).

Use this table to answer: “Which rate bundles have a discount campaign set on them?” and “Does this campaign apply to all bundles or only specific ones?”

Join with dim_discount_campaign_discount_period on discount_campaign_scope_id to get the actual discount amounts for each scoped entry.

bridge_rate_bundle_term_availability 0 1 5 Table

Bridge table listing which organization units can sell each rate bundle term, driven by the bundle whitelist and active bundle group configuration.

bridge_rate_bundle_to_company 0 1 7 Table

Bridge table linking rate bundles to partner companies for corporate deals, including any cooperation identifier used for that partnership.

bridge_rate_bundle_payment_choice 0 1 4 Table

Bridge table listing which payment choices are allowed when selling a rate bundle.

dim_rate_term_payment_frequency_term_to_price 0 0 6 Table

Price definitions for payment frequencies based on term length.