snapshots:
  - name: rds_profile_follow__snapshot
    description: |
      SCD Type 2 snapshot of the rds_profile_follow table tracking follower/following relationships over time.
      Captures all changes to follow relationships with dbt_valid_from and dbt_valid_to timestamps.
      This allows for point-in-time analysis of user social graph and follower growth patterns.
      Clustered by dbt_valid_from date for efficient temporal queries.
    config:
      group: rds_snapshots
      tags: ['snapshot']
      strategy: timestamp
      unique_key: id
      updated_at: updated_at
      invalidate_hard_deletes: true
    meta:
      dagster:
        partitions_def: # Although dbt snapshots do not currently support partitions, we need to define a Dagster partition definition for downstream models to use automation conditions
          type: daily
          start_date: 2025-11-11
          end_offset: 0
        partition_mappings:
          - asset_key: ['prod_stg', 'stg_rds__profile_follow']
            type: last
        automation_condition: daily_cron
    columns:
      - name: id
        description: "Unique follow relationship identifier (from source table)"
      - name: follower_user_id
        description: "User ID of the person being followed (mapped from discord_id via rds_discord_info)"
      - name: following_user_id
        description: "User ID of the person doing the following (mapped from discord_id via rds_discord_info)"
      - name: follower_discord_id
        description: "Discord ID of the profile being followed (original from rds_profile_follow)"
      - name: following_discord_id
        description: "Discord ID of the profile doing the following (original from rds_profile_follow)"
      - name: created_at
        description: "When the follow relationship was originally created"
      - name: updated_at
        description: "Last update timestamp (used for snapshot strategy)"
      - name: p_date
        description: "Partition date from source table"
      - name: dbt_scd_id
        description: "Unique identifier for this SCD record (generated by dbt)"
      - name: dbt_updated_at
        description: "When dbt last updated this record"
      - name: dbt_valid_from
        description: "Timestamp when this version of the record became valid"
      - name: dbt_valid_to
        description: "Timestamp when this version of the record became invalid (NULL if current)"
      - name: p_date
        description: "Partition date from dbt updated at timestamp"
