# countmein

## Tables

| Name | Columns | Comment | Type |
| ---- | ------- | ------- | ---- |
| [current_organization_calendars](current_organization_calendars.md) | 2 | VIEW | VIEW |
| [calendars_organizations_labels](calendars_organizations_labels.md) | 2 |  | BASE TABLE |
| [current_member_roles](current_member_roles.md) | 4 | VIEW | VIEW |
| [calendars_users_labels](calendars_users_labels.md) | 2 |  | BASE TABLE |
| [member_moderations_history](member_moderations_history.md) | 8 |  | BASE TABLE |
| [join_response_details](join_response_details.md) | 9 | VIEW | VIEW |
| [organization_members_history](organization_members_history.md) | 5 |  | BASE TABLE |
| [current_memberships](current_memberships.md) | 2 | VIEW | VIEW |
| [users](users.md) | 6 |  | BASE TABLE |
| [join_responses_history](join_responses_history.md) | 5 |  | BASE TABLE |
| [organizations_labels](organizations_labels.md) | 4 |  | BASE TABLE |
| [calendars](calendars.md) | 4 |  | BASE TABLE |
| [join_prompts_history](join_prompts_history.md) | 5 |  | BASE TABLE |
| [join_requests_history](join_requests_history.md) | 5 |  | BASE TABLE |
| [users_labels](users_labels.md) | 4 |  | BASE TABLE |
| [organization_calendars_history](organization_calendars_history.md) | 6 |  | BASE TABLE |
| [users_sessions](users_sessions.md) | 3 |  | BASE TABLE |
| [member_roles_history](member_roles_history.md) | 6 |  | BASE TABLE |
| [open_join_requests](open_join_requests.md) | 6 | VIEW | VIEW |
| [calendar_writes_history](calendar_writes_history.md) | 5 |  | BASE TABLE |
| [organizations](organizations.md) | 5 |  | BASE TABLE |

## Stored procedures and functions

| Name | ReturnType | Arguments | Type |
| ---- | ------- | ------- | ---- |
| ban_member |  | p_actor_user_id bigint; p_organization_id bigint; p_member_user_id bigint; p_reason varchar; p_expires_at_secs bigint | PROCEDURE |
| create_calendar |  | p_actor_user_id bigint; p_name varchar; p_ical longblob; p_description text; p_AES_SECRET_KEY binary; out_calendar_id bigint | PROCEDURE |
| create_join_request |  | p_actor_user_id bigint; p_join_response_event_id bigint; out_join_request_event_id bigint | PROCEDURE |
| create_organization |  | p_actor_user_id bigint; p_name varchar; p_requires_join_request tinyint; p_description text; out_organization_id bigint | PROCEDURE |
| join_organization |  | p_actor_user_id bigint; p_organization_id bigint | PROCEDURE |
| leave_organization |  | p_actor_user_id bigint; p_organization_id bigint | PROCEDURE |
| must_have_one_owner |  | p_organization_id bigint | PROCEDURE |
| resolve_join_request |  | p_actor_user_id bigint; p_organization_id bigint; p_requester_user_id bigint; p_accept tinyint | PROCEDURE |
| set_member_role |  | p_actor_user_id bigint; p_organization_id bigint; p_member_user_id bigint; p_role enum | PROCEDURE |
| SSELECT |  | p_table varchar; p_database varchar; p_where varchar | PROCEDURE |
| toggle_share_user_calendar |  | p_actor_user_id bigint; p_organization_id bigint; p_calendar_id bigint | PROCEDURE |
| unsafe_add_member |  | p_organization_id bigint; p_unsafe_user_id bigint | PROCEDURE |

## Relations

![er](schema.svg)

---

> Generated by [tbls](https://github.com/k1LoW/tbls)
