# Zingtree schema ERD

Table and field reference for the Fivetran Zingtree connector.

## Table & Field Reference

### session_data_path

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| tree_id | String | FK |
| button_text | String |  |
| from_node_id | String |  |
| page_title | String |  |
| question | String |  |
| seconds | Long |  |
| seq | Int |  |
| source | String |  |
| subtree | String |  |
| time | String |  |
| to_node_id | String |  |

### session_data

| Column | Type | Keys |
| --- | --- | --- |
| session_id | String | PK, FK |
| tree_id | String | PK, FK |
| browser | String |  |
| duration_seconds | Long |  |
| ip | String |  |
| last_click_time_pst | Instant |  |
| last_click_time_utc | Instant |  |
| notes | String |  |
| os | String |  |
| result | String |  |
| source | String |  |
| start_time_pst | Instant |  |
| start_time_utc | Instant |  |
| time_spent | String |  |
| total_score | String |  |
| tree_name | String |  |

### tree_session

| Column | Type | Keys |
| --- | --- | --- |
| session_id | String | PK, FK |
| tree_id | String | PK, FK |
| agent | String |  |
| duration | String |  |
| last_click_time | Instant |  |
| resolution_state | String |  |
| start_time | Instant |  |
| total_score | String |  |

### tree_structure_node_button

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| tree_structure_node_node_id | String | FK |
| button_link | String |  |
| button_text | String |  |

### tree_structure_node

| Column | Type | Keys |
| --- | --- | --- |
| node_id | String | PK |
| tree_id | String | PK, FK |
| root_node_id | String | FK |
| content | String |  |
| keyword | String |  |
| open_tree_id | String |  |
| page_title | String |  |
| question | String |  |
| success | String |  |
| tags | String |  |
| type | String |  |

### tree_structure

| Column | Type | Keys |
| --- | --- | --- |
| root_node_id | String | PK |
| tree_id | String | PK, FK |
| description | String |  |
| tree_name | String |  |

### session_note

| Column | Type | Keys |
| --- | --- | --- |
| note | String | PK |
| session_id | String | PK, FK |

### agent_session

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| tree_id | String | FK |
| agent | String |  |
| resolution_state | String |  |
| start_time | Instant |  |
| total_score | String |  |

### form_data

| Column | Type | Keys |
| --- | --- | --- |
| session_id | String | PK, FK |
| agent | String |  |
| agent_first_name | String |  |
| agent_name | String |  |
| comment | String |  |
| organization | String |  |

### event_log

| Column | Type | Keys |
| --- | --- | --- |
| session_id | String | PK |
| timestamp | Instant | PK |
| id | Unknown | FK |
| tree_id | String | FK |
| data | String |  |
| details | String |  |
| ip | String |  |
| severity | String |  |
| type | String |  |
| user_name | String |  |

### tree_variable_var

| Column | Type | Keys |
| --- | --- | --- |
| tree_id | String | PK |
| variable_name | String | PK |

### tree

| Column | Type | Keys |
| --- | --- | --- |
| tree_id | String | PK |
| description | String |  |
| name | String |  |
| tags | String |  |

## Relationships

- session_data_path(tree_id) → session_data(tree_id)
- session_data(tree_id) → tree(tree_id)
- session_data(session_id) → agent_session(id)
- tree_session(session_id) → agent_session(id)
- tree_session(tree_id) → tree(tree_id)
- tree_structure_node_button(tree_structure_node_node_id) → tree_structure_node(node_id)
- tree_structure_node(tree_id) → tree_structure(tree_id)
- tree_structure_node(root_node_id) → tree_structure(root_node_id)
- tree_structure(tree_id) → tree(tree_id)
- session_note(session_id) → agent_session(id)
- agent_session(tree_id) → tree(tree_id)
- form_data(session_id) → agent_session(id)
- event_log(tree_id) → tree(tree_id)
- event_log(id) → agent_session(id)
