The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.
TypeScript ai-receptionistanswering-serviceappointment-bookinglivekitlocal-firstmcpopen-sourceself-hostedsiptelephonytypescriptvoice-agentvoice-ai
{
"id": "b6844c87-48a2-4feb-be45-b0031b70278b",
"prevId": "7c08c9b2-c463-45a1-8eec-9353178b20d8",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.api_keys": {
"name": "api_keys",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"prefix": {
"name": "prefix",
"type": "text",
"primaryKey": false,
"notNull": true
},
"key_hash": {
"name": "key_hash",
"type": "text",
"primaryKey": false,
"notNull": true
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'member'"
},
"created_by": {
"name": "created_by",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"last_used_at": {
"name": "last_used_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"revoked_at": {
"name": "revoked_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"api_keys_ws": {
"name": "api_keys_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"api_keys_key_hash_unique": {
"name": "api_keys_key_hash_unique",
"columns": [
"key_hash"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.appointment_types": {
"name": "appointment_types",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"duration_min": {
"name": "duration_min",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"buffer_min": {
"name": "buffer_min",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"buffer_before_min": {
"name": "buffer_before_min",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"buffer_after_min": {
"name": "buffer_after_min",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"book_when": {
"name": "book_when",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'business_hours'"
},
"min_notice_hours": {
"name": "min_notice_hours",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"max_days_ahead": {
"name": "max_days_ahead",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 60
},
"location": {
"name": "location",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'on_site'"
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"required_fields": {
"name": "required_fields",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"name_required": {
"name": "name_required",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"instruction": {
"name": "instruction",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"appointment_types_ws": {
"name": "appointment_types_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"appointment_types_duration": {
"name": "appointment_types_duration",
"value": "\"appointment_types\".\"duration_min\" > 0"
},
"appointment_types_buffer": {
"name": "appointment_types_buffer",
"value": "\"appointment_types\".\"buffer_min\" >= 0"
},
"appointment_types_buffer_before": {
"name": "appointment_types_buffer_before",
"value": "\"appointment_types\".\"buffer_before_min\" >= 0"
},
"appointment_types_buffer_after": {
"name": "appointment_types_buffer_after",
"value": "\"appointment_types\".\"buffer_after_min\" >= 0"
},
"appointment_types_min_notice": {
"name": "appointment_types_min_notice",
"value": "\"appointment_types\".\"min_notice_hours\" >= 0"
},
"appointment_types_max_days": {
"name": "appointment_types_max_days",
"value": "\"appointment_types\".\"max_days_ahead\" > 0"
}
},
"isRLSEnabled": false
},
"public.assistant_calendars": {
"name": "assistant_calendars",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"assistant_id": {
"name": "assistant_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"connection_id": {
"name": "connection_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"external_id": {
"name": "external_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"instruction": {
"name": "instruction",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"is_default": {
"name": "is_default",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"assistant_calendars_ws": {
"name": "assistant_calendars_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"assistant_calendars_assistant_id_assistants_id_fk": {
"name": "assistant_calendars_assistant_id_assistants_id_fk",
"tableFrom": "assistant_calendars",
"columnsFrom": [
"assistant_id"
],
"tableTo": "assistants",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"assistant_calendars_connection_id_calendar_connections_id_fk": {
"name": "assistant_calendars_connection_id_calendar_connections_id_fk",
"tableFrom": "assistant_calendars",
"columnsFrom": [
"connection_id"
],
"tableTo": "calendar_connections",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"assistant_calendars_calendar": {
"name": "assistant_calendars_calendar",
"columns": [
"assistant_id",
"connection_id",
"external_id"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.assistants": {
"name": "assistants",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'Maya'"
},
"greeting": {
"name": "greeting",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"disclose_ai": {
"name": "disclose_ai",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"record_calls": {
"name": "record_calls",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"greet_by_name": {
"name": "greet_by_name",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"greeting_known_caller": {
"name": "greeting_known_caller",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'Hi {first_name}, good to hear from you again.'"
},
"voice": {
"name": "voice",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{\"provider\":\"elevenlabs\",\"voice_id\":\"\"}'::jsonb"
},
"business_profile": {
"name": "business_profile",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"call_rules": {
"name": "call_rules",
"type": "text",
"primaryKey": false,
"notNull": false
},
"greeting_outside": {
"name": "greeting_outside",
"type": "text",
"primaryKey": false,
"notNull": false
},
"instructions_outside": {
"name": "instructions_outside",
"type": "text",
"primaryKey": false,
"notNull": false
},
"transfers": {
"name": "transfers",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[{\"id\":\"person\",\"name\":\"Owner\",\"number\":null,\"condition\":\"The caller asks to speak to a person\",\"hours_only\":true,\"ring_seconds\":25,\"if_no_answer\":\"message\",\"enabled\":true}]'::jsonb"
},
"transfer_urgent": {
"name": "transfer_urgent",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"transfer_number": {
"name": "transfer_number",
"type": "text",
"primaryKey": false,
"notNull": false
},
"transfer_hours_only": {
"name": "transfer_hours_only",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"silence_first_gap_s": {
"name": "silence_first_gap_s",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 8
},
"silence_reminders": {
"name": "silence_reminders",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 2
},
"silence_closing": {
"name": "silence_closing",
"type": "text",
"primaryKey": false,
"notNull": false
},
"keypad_menu": {
"name": "keypad_menu",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"assistants_ws": {
"name": "assistants_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.auth_events": {
"name": "auth_events",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false
},
"event": {
"name": "event",
"type": "text",
"primaryKey": false,
"notNull": true
},
"method": {
"name": "method",
"type": "text",
"primaryKey": false,
"notNull": false
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"ip_address": {
"name": "ip_address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"user_agent": {
"name": "user_agent",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"auth_events_created": {
"name": "auth_events_created",
"columns": [
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"auth_events_user": {
"name": "auth_events_user",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.availability_exceptions": {
"name": "availability_exceptions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"date": {
"name": "date",
"type": "date",
"primaryKey": false,
"notNull": true
},
"start_time": {
"name": "start_time",
"type": "time",
"primaryKey": false,
"notNull": false
},
"end_time": {
"name": "end_time",
"type": "time",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"availability_exceptions_ws_date": {
"name": "availability_exceptions_ws_date",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "date",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"availability_exceptions_times": {
"name": "availability_exceptions_times",
"value": "(\"availability_exceptions\".\"start_time\" is null and \"availability_exceptions\".\"end_time\" is null) or coalesce(\"availability_exceptions\".\"end_time\" > \"availability_exceptions\".\"start_time\", false)"
}
},
"isRLSEnabled": false
},
"public.availability_rules": {
"name": "availability_rules",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"weekday": {
"name": "weekday",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"start_time": {
"name": "start_time",
"type": "time",
"primaryKey": false,
"notNull": true
},
"end_time": {
"name": "end_time",
"type": "time",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"availability_rules_ws": {
"name": "availability_rules_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"availability_rules_weekday": {
"name": "availability_rules_weekday",
"value": "\"availability_rules\".\"weekday\" between 0 and 6"
},
"availability_rules_times": {
"name": "availability_rules_times",
"value": "\"availability_rules\".\"end_time\" > \"availability_rules\".\"start_time\""
}
},
"isRLSEnabled": false
},
"public.bookings": {
"name": "bookings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"call_id": {
"name": "call_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"contact_id": {
"name": "contact_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"appointment_type_id": {
"name": "appointment_type_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"start_at": {
"name": "start_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"end_at": {
"name": "end_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'confirmed'"
},
"calendar_id": {
"name": "calendar_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"external_event_id": {
"name": "external_event_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
"calendar_name": {
"name": "calendar_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"caller_email": {
"name": "caller_email",
"type": "text",
"primaryKey": false,
"notNull": false
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"confirmation": {
"name": "confirmation",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"bookings_ws_start": {
"name": "bookings_ws_start",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "start_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"bookings_call_id_calls_id_fk": {
"name": "bookings_call_id_calls_id_fk",
"tableFrom": "bookings",
"columnsFrom": [
"call_id"
],
"tableTo": "calls",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
},
"bookings_contact_id_contacts_id_fk": {
"name": "bookings_contact_id_contacts_id_fk",
"tableFrom": "bookings",
"columnsFrom": [
"contact_id"
],
"tableTo": "contacts",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "no action"
},
"bookings_appointment_type_id_appointment_types_id_fk": {
"name": "bookings_appointment_type_id_appointment_types_id_fk",
"tableFrom": "bookings",
"columnsFrom": [
"appointment_type_id"
],
"tableTo": "appointment_types",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"bookings_times": {
"name": "bookings_times",
"value": "\"bookings\".\"end_at\" > \"bookings\".\"start_at\""
}
},
"isRLSEnabled": false
},
"public.calendar_connections": {
"name": "calendar_connections",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true
},
"account_email": {
"name": "account_email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'connected'"
},
"last_error": {
"name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"connected_by": {
"name": "connected_by",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"calendar_connections_ws": {
"name": "calendar_connections_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"calendar_connections_account": {
"name": "calendar_connections_account",
"columns": [
"workspace_id",
"provider",
"account_email"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.calendar_credentials": {
"name": "calendar_credentials",
"schema": "",
"columns": {
"connection_id": {
"name": "connection_id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"access_token_encrypted": {
"name": "access_token_encrypted",
"type": "text",
"primaryKey": false,
"notNull": true
},
"refresh_token_encrypted": {
"name": "refresh_token_encrypted",
"type": "text",
"primaryKey": false,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"scope": {
"name": "scope",
"type": "text",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"calendar_credentials_connection_id_calendar_connections_id_fk": {
"name": "calendar_credentials_connection_id_calendar_connections_id_fk",
"tableFrom": "calendar_credentials",
"columnsFrom": [
"connection_id"
],
"tableTo": "calendar_connections",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.calendar_oauth_states": {
"name": "calendar_oauth_states",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true
},
"code_verifier": {
"name": "code_verifier",
"type": "text",
"primaryKey": false,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.call_evaluations": {
"name": "call_evaluations",
"schema": "",
"columns": {
"call_id": {
"name": "call_id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"score": {
"name": "score",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"issues": {
"name": "issues",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"model": {
"name": "model",
"type": "text",
"primaryKey": false,
"notNull": false
},
"assistant_version": {
"name": "assistant_version",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"call_evaluations_ws_score": {
"name": "call_evaluations_ws_score",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "score",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"call_evaluations_call_id_calls_id_fk": {
"name": "call_evaluations_call_id_calls_id_fk",
"tableFrom": "call_evaluations",
"columnsFrom": [
"call_id"
],
"tableTo": "calls",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.call_events": {
"name": "call_events",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"call_id": {
"name": "call_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"kind": {
"name": "kind",
"type": "text",
"primaryKey": false,
"notNull": true
},
"actor_id": {
"name": "actor_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"assignee_id": {
"name": "assignee_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"call_events_call": {
"name": "call_events_call",
"columns": [
{
"expression": "call_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"call_events_call_id_calls_id_fk": {
"name": "call_events_call_id_calls_id_fk",
"tableFrom": "call_events",
"columnsFrom": [
"call_id"
],
"tableTo": "calls",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.calls": {
"name": "calls",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"contact_id": {
"name": "contact_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"from_number": {
"name": "from_number",
"type": "text",
"primaryKey": false,
"notNull": true
},
"to_number": {
"name": "to_number",
"type": "text",
"primaryKey": false,
"notNull": true
},
"direction": {
"name": "direction",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'in'"
},
"source": {
"name": "source",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'phone'"
},
"started_at": {
"name": "started_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"ended_at": {
"name": "ended_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"duration_sec": {
"name": "duration_sec",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'live'"
},
"outcome": {
"name": "outcome",
"type": "text",
"primaryKey": false,
"notNull": false
},
"urgency": {
"name": "urgency",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'normal'"
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
"summary": {
"name": "summary",
"type": "text",
"primaryKey": false,
"notNull": false
},
"action_items": {
"name": "action_items",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"fields": {
"name": "fields",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"caller_name": {
"name": "caller_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"callback_number": {
"name": "callback_number",
"type": "text",
"primaryKey": false,
"notNull": false
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"job_type": {
"name": "job_type",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tag": {
"name": "tag",
"type": "text",
"primaryKey": false,
"notNull": false
},
"custom_values": {
"name": "custom_values",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"answered_by": {
"name": "answered_by",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'ai'"
},
"recording_key": {
"name": "recording_key",
"type": "text",
"primaryKey": false,
"notNull": false
},
"recording_store": {
"name": "recording_store",
"type": "text",
"primaryKey": false,
"notNull": false
},
"room": {
"name": "room",
"type": "text",
"primaryKey": false,
"notNull": false
},
"assistant_id": {
"name": "assistant_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"inbox_state": {
"name": "inbox_state",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'open'"
},
"reminder_at": {
"name": "reminder_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"reminder_label": {
"name": "reminder_label",
"type": "text",
"primaryKey": false,
"notNull": false
},
"unread": {
"name": "unread",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"assignee_id": {
"name": "assignee_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"transfer_to": {
"name": "transfer_to",
"type": "text",
"primaryKey": false,
"notNull": false
},
"transfer_name": {
"name": "transfer_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"transfer_result": {
"name": "transfer_result",
"type": "text",
"primaryKey": false,
"notNull": false
},
"transfer_at": {
"name": "transfer_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"booking_misses": {
"name": "booking_misses",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"calls_ws_started": {
"name": "calls_ws_started",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "started_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"calls_contact_id_contacts_id_fk": {
"name": "calls_contact_id_contacts_id_fk",
"tableFrom": "calls",
"columnsFrom": [
"contact_id"
],
"tableTo": "contacts",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.commands": {
"name": "commands",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"actor_id": {
"name": "actor_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"action": {
"name": "action",
"type": "text",
"primaryKey": false,
"notNull": true
},
"input": {
"name": "input",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"result": {
"name": "result",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"rejected": {
"name": "rejected",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"impersonated_by": {
"name": "impersonated_by",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"pruned_at": {
"name": "pruned_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"commands_unpruned_created": {
"name": "commands_unpruned_created",
"columns": [
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"where": "\"commands\".\"pruned_at\" is null",
"concurrently": false
},
"commands_unpruned_input": {
"name": "commands_unpruned_input",
"columns": [
{
"expression": "input",
"isExpression": false,
"asc": true,
"nulls": "last",
"opclass": "jsonb_path_ops"
}
],
"isUnique": false,
"with": {},
"method": "gin",
"where": "\"commands\".\"pruned_at\" is null",
"concurrently": false
},
"commands_unpruned_result": {
"name": "commands_unpruned_result",
"columns": [
{
"expression": "result",
"isExpression": false,
"asc": true,
"nulls": "last",
"opclass": "jsonb_path_ops"
}
],
"isUnique": false,
"with": {},
"method": "gin",
"where": "\"commands\".\"pruned_at\" is null",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.contacts": {
"name": "contacts",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"company": {
"name": "company",
"type": "text",
"primaryKey": false,
"notNull": false
},
"phone": {
"name": "phone",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"note": {
"name": "note",
"type": "text",
"primaryKey": false,
"notNull": false
},
"blocked_at": {
"name": "blocked_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"merged_into": {
"name": "merged_into",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"contacts_ws_phone": {
"name": "contacts_ws_phone",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "phone",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.custom_fields": {
"name": "custom_fields",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": true
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"options": {
"name": "options",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"ask_caller": {
"name": "ask_caller",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"instruction": {
"name": "instruction",
"type": "text",
"primaryKey": false,
"notNull": false
},
"position": {
"name": "position",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"custom_fields_ws": {
"name": "custom_fields_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.instance_settings": {
"name": "instance_settings",
"schema": "",
"columns": {
"key": {
"name": "key",
"type": "text",
"primaryKey": true,
"notNull": true
},
"value": {
"name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_by": {
"name": "updated_by",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.knowledge_chunks": {
"name": "knowledge_chunks",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"document_id": {
"name": "document_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"assistant_id": {
"name": "assistant_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"position": {
"name": "position",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": true
},
"search": {
"name": "search",
"type": "tsvector",
"primaryKey": false,
"notNull": true,
"generated": {
"type": "stored",
"as": "to_tsvector('english', text)"
}
}
},
"indexes": {
"knowledge_chunks_assistant": {
"name": "knowledge_chunks_assistant",
"columns": [
{
"expression": "assistant_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"knowledge_chunks_search": {
"name": "knowledge_chunks_search",
"columns": [
{
"expression": "search",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "gin",
"concurrently": false
}
},
"foreignKeys": {
"knowledge_chunks_document_id_knowledge_documents_id_fk": {
"name": "knowledge_chunks_document_id_knowledge_documents_id_fk",
"tableFrom": "knowledge_chunks",
"columnsFrom": [
"document_id"
],
"tableTo": "knowledge_documents",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.knowledge_documents": {
"name": "knowledge_documents",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"assistant_id": {
"name": "assistant_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"mime_type": {
"name": "mime_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"size_bytes": {
"name": "size_bytes",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"chars": {
"name": "chars",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"store": {
"name": "store",
"type": "text",
"primaryKey": false,
"notNull": false
},
"storage_key": {
"name": "storage_key",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_by": {
"name": "created_by",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"knowledge_documents_ws": {
"name": "knowledge_documents_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"knowledge_documents_assistant": {
"name": "knowledge_documents_assistant",
"columns": [
{
"expression": "assistant_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"knowledge_documents_assistant_id_assistants_id_fk": {
"name": "knowledge_documents_assistant_id_assistants_id_fk",
"tableFrom": "knowledge_documents",
"columnsFrom": [
"assistant_id"
],
"tableTo": "assistants",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.knowledge_questions": {
"name": "knowledge_questions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"assistant_id": {
"name": "assistant_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"call_id": {
"name": "call_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"question": {
"name": "question",
"type": "text",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'open'"
},
"resolved_at": {
"name": "resolved_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"knowledge_questions_ws": {
"name": "knowledge_questions_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"knowledge_questions_assistant": {
"name": "knowledge_questions_assistant",
"columns": [
{
"expression": "assistant_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"knowledge_questions_assistant_id_assistants_id_fk": {
"name": "knowledge_questions_assistant_id_assistants_id_fk",
"tableFrom": "knowledge_questions",
"columnsFrom": [
"assistant_id"
],
"tableTo": "assistants",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"knowledge_questions_call_id_calls_id_fk": {
"name": "knowledge_questions_call_id_calls_id_fk",
"tableFrom": "knowledge_questions",
"columnsFrom": [
"call_id"
],
"tableTo": "calls",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.member_notification_settings": {
"name": "member_notification_settings",
"schema": "",
"columns": {
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"browser": {
"name": "browser",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"push_summary": {
"name": "push_summary",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"assigned_email": {
"name": "assigned_email",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"member_notification_settings_workspace_id_user_id_pk": {
"name": "member_notification_settings_workspace_id_user_id_pk",
"columns": [
"workspace_id",
"user_id"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.number_purchases": {
"name": "number_purchases",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"actor_id": {
"name": "actor_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"e164": {
"name": "e164",
"type": "text",
"primaryKey": false,
"notNull": true
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true
},
"carrier_account": {
"name": "carrier_account",
"type": "text",
"primaryKey": false,
"notNull": true
},
"by_admin": {
"name": "by_admin",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {
"number_purchases_ws": {
"name": "number_purchases_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"number_purchases_created": {
"name": "number_purchases_created",
"columns": [
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.phone_numbers": {
"name": "phone_numbers",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"e164": {
"name": "e164",
"type": "text",
"primaryKey": false,
"notNull": true
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true
},
"mode": {
"name": "mode",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'forward_conditional'"
},
"forwarded_from": {
"name": "forwarded_from",
"type": "text",
"primaryKey": false,
"notNull": false
},
"provider_ref": {
"name": "provider_ref",
"type": "text",
"primaryKey": false,
"notNull": false
},
"carrier_account": {
"name": "carrier_account",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'install'"
},
"purchased": {
"name": "purchased",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"assistant_id": {
"name": "assistant_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"verified_at": {
"name": "verified_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"phone_numbers_ws": {
"name": "phone_numbers_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"phone_numbers_e164_unique": {
"name": "phone_numbers_e164_unique",
"columns": [
"e164"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.provider_settings": {
"name": "provider_settings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true
},
"field": {
"name": "field",
"type": "text",
"primaryKey": false,
"notNull": true
},
"value_encrypted": {
"name": "value_encrypted",
"type": "text",
"primaryKey": false,
"notNull": true
},
"last4": {
"name": "last4",
"type": "text",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_by": {
"name": "updated_by",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"provider_settings_slot": {
"name": "provider_settings_slot",
"columns": [
"workspace_id",
"provider",
"field"
],
"nullsNotDistinct": true
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.push_subscriptions": {
"name": "push_subscriptions",
"schema": "",
"columns": {
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"endpoint": {
"name": "endpoint",
"type": "text",
"primaryKey": false,
"notNull": true
},
"p256dh": {
"name": "p256dh",
"type": "text",
"primaryKey": false,
"notNull": true
},
"auth": {
"name": "auth",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"push_subscriptions_user_idx": {
"name": "push_subscriptions_user_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {
"push_subscriptions_workspace_id_endpoint_pk": {
"name": "push_subscriptions_workspace_id_endpoint_pk",
"columns": [
"workspace_id",
"endpoint"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.spending_cap_alerts": {
"name": "spending_cap_alerts",
"schema": "",
"columns": {
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"month": {
"name": "month",
"type": "text",
"primaryKey": false,
"notNull": true
},
"level": {
"name": "level",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"spending_cap_alerts_workspace_id_month_level_pk": {
"name": "spending_cap_alerts_workspace_id_month_level_pk",
"columns": [
"workspace_id",
"month",
"level"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.star_prompts": {
"name": "star_prompts",
"schema": "",
"columns": {
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"answer": {
"name": "answer",
"type": "text",
"primaryKey": false,
"notNull": true
},
"answered_at": {
"name": "answered_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.transcript_segments": {
"name": "transcript_segments",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"call_id": {
"name": "call_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"speaker": {
"name": "speaker",
"type": "text",
"primaryKey": false,
"notNull": true
},
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": true
},
"at_ms": {
"name": "at_ms",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"tool_event": {
"name": "tool_event",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"segments_call": {
"name": "segments_call",
"columns": [
{
"expression": "call_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "at_ms",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"transcript_segments_call_id_calls_id_fk": {
"name": "transcript_segments_call_id_calls_id_fk",
"tableFrom": "transcript_segments",
"columnsFrom": [
"call_id"
],
"tableTo": "calls",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.voice_clones": {
"name": "voice_clones",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true
},
"voice_id": {
"name": "voice_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"consent_by": {
"name": "consent_by",
"type": "text",
"primaryKey": false,
"notNull": true
},
"consent_at": {
"name": "consent_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"consent_text": {
"name": "consent_text",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"voice_clones_ws": {
"name": "voice_clones_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"voice_clones_voice": {
"name": "voice_clones_voice",
"columns": [
"provider",
"voice_id"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.webhook_deliveries": {
"name": "webhook_deliveries",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"endpoint_id": {
"name": "endpoint_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"event": {
"name": "event",
"type": "text",
"primaryKey": false,
"notNull": true
},
"payload": {
"name": "payload",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"attempts": {
"name": "attempts",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"response_status": {
"name": "response_status",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"error": {
"name": "error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_attempt_at": {
"name": "last_attempt_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"webhook_deliveries_endpoint": {
"name": "webhook_deliveries_endpoint",
"columns": [
{
"expression": "endpoint_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"webhook_deliveries_endpoint_id_webhook_endpoints_id_fk": {
"name": "webhook_deliveries_endpoint_id_webhook_endpoints_id_fk",
"tableFrom": "webhook_deliveries",
"columnsFrom": [
"endpoint_id"
],
"tableTo": "webhook_endpoints",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.webhook_endpoints": {
"name": "webhook_endpoints",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"events": {
"name": "events",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'active'"
},
"disabled_reason": {
"name": "disabled_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"failure_count": {
"name": "failure_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"last_delivery_at": {
"name": "last_delivery_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"created_by": {
"name": "created_by",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"webhook_endpoints_ws": {
"name": "webhook_endpoints_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.webhook_secrets": {
"name": "webhook_secrets",
"schema": "",
"columns": {
"endpoint_id": {
"name": "endpoint_id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"secret_encrypted": {
"name": "secret_encrypted",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"webhook_secrets_endpoint_id_webhook_endpoints_id_fk": {
"name": "webhook_secrets_endpoint_id_webhook_endpoints_id_fk",
"tableFrom": "webhook_secrets",
"columnsFrom": [
"endpoint_id"
],
"tableTo": "webhook_endpoints",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.workspace_members": {
"name": "workspace_members",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true
},
"disabled": {
"name": "disabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {
"workspace_members_ws": {
"name": "workspace_members_ws",
"columns": [
{
"expression": "workspace_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.workspace_settings": {
"name": "workspace_settings",
"schema": "",
"columns": {
"workspace_id": {
"name": "workspace_id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"timezone": {
"name": "timezone",
"type": "text",
"primaryKey": false,
"notNull": true
},
"onboarding_step": {
"name": "onboarding_step",
"type": "text",
"primaryKey": false,
"notNull": false
},
"recording_retention_days": {
"name": "recording_retention_days",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 90
},
"notify_email_default": {
"name": "notify_email_default",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"notify_browser_default": {
"name": "notify_browser_default",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"business_hours_on": {
"name": "business_hours_on",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"recording_notice_on": {
"name": "recording_notice_on",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"recording_notice": {
"name": "recording_notice",
"type": "text",
"primaryKey": false,
"notNull": false
},
"carrier": {
"name": "carrier",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'default'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"version": {
"name": "version",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": "nextval('row_version')"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.account": {
"name": "account",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"account_id": {
"name": "account_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"provider_id": {
"name": "provider_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"access_token": {
"name": "access_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"refresh_token": {
"name": "refresh_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"id_token": {
"name": "id_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"access_token_expires_at": {
"name": "access_token_expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"refresh_token_expires_at": {
"name": "refresh_token_expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"scope": {
"name": "scope",
"type": "text",
"primaryKey": false,
"notNull": false
},
"password": {
"name": "password",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"account_userId_idx": {
"name": "account_userId_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"account_user_id_user_id_fk": {
"name": "account_user_id_user_id_fk",
"tableFrom": "account",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.invitation": {
"name": "invitation",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"organization_id": {
"name": "organization_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"expires_at": {
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"inviter_id": {
"name": "inviter_id",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"invitation_organizationId_idx": {
"name": "invitation_organizationId_idx",
"columns": [
{
"expression": "organization_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"invitation_email_idx": {
"name": "invitation_email_idx",
"columns": [
{
"expression": "email",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"invitation_organization_id_organization_id_fk": {
"name": "invitation_organization_id_organization_id_fk",
"tableFrom": "invitation",
"columnsFrom": [
"organization_id"
],
"tableTo": "organization",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"invitation_inviter_id_user_id_fk": {
"name": "invitation_inviter_id_user_id_fk",
"tableFrom": "invitation",
"columnsFrom": [
"inviter_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.member": {
"name": "member",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"organization_id": {
"name": "organization_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'member'"
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"member_organizationId_idx": {
"name": "member_organizationId_idx",
"columns": [
{
"expression": "organization_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"member_userId_idx": {
"name": "member_userId_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"member_organization_user_uidx": {
"name": "member_organization_user_uidx",
"columns": [
{
"expression": "organization_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"member_organization_id_organization_id_fk": {
"name": "member_organization_id_organization_id_fk",
"tableFrom": "member",
"columnsFrom": [
"organization_id"
],
"tableTo": "organization",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"member_user_id_user_id_fk": {
"name": "member_user_id_user_id_fk",
"tableFrom": "member",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.organization": {
"name": "organization",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"slug": {
"name": "slug",
"type": "text",
"primaryKey": false,
"notNull": true
},
"logo": {
"name": "logo",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"metadata": {
"name": "metadata",
"type": "text",
"primaryKey": false,
"notNull": false
},
"disabled_at": {
"name": "disabled_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"spending_cap_cents": {
"name": "spending_cap_cents",
"type": "integer",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"organization_slug_uidx": {
"name": "organization_slug_uidx",
"columns": [
{
"expression": "slug",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"organization_slug_unique": {
"name": "organization_slug_unique",
"columns": [
"slug"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.passkey": {
"name": "passkey",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"public_key": {
"name": "public_key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"credential_id": {
"name": "credential_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"counter": {
"name": "counter",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"device_type": {
"name": "device_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"backed_up": {
"name": "backed_up",
"type": "boolean",
"primaryKey": false,
"notNull": true
},
"transports": {
"name": "transports",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"aaguid": {
"name": "aaguid",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"passkey_userId_idx": {
"name": "passkey_userId_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"passkey_credentialID_uidx": {
"name": "passkey_credentialID_uidx",
"columns": [
{
"expression": "credential_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"passkey_user_id_user_id_fk": {
"name": "passkey_user_id_user_id_fk",
"tableFrom": "passkey",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.session": {
"name": "session",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"token": {
"name": "token",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"ip_address": {
"name": "ip_address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"user_agent": {
"name": "user_agent",
"type": "text",
"primaryKey": false,
"notNull": false
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"active_organization_id": {
"name": "active_organization_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"impersonated_by": {
"name": "impersonated_by",
"type": "text",
"primaryKey": false,
"notNull": false
},
"passkey_verified_at": {
"name": "passkey_verified_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"session_userId_idx": {
"name": "session_userId_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"session_user_id_user_id_fk": {
"name": "session_user_id_user_id_fk",
"tableFrom": "session",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"session_impersonated_by_user_id_fk": {
"name": "session_impersonated_by_user_id_fk",
"tableFrom": "session",
"columnsFrom": [
"impersonated_by"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"session_token_unique": {
"name": "session_token_unique",
"columns": [
"token"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.user": {
"name": "user",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email_verified": {
"name": "email_verified",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"image": {
"name": "image",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"instance_admin": {
"name": "instance_admin",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"disabled_at": {
"name": "disabled_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"last_sign_in_at": {
"name": "last_sign_in_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"passkey_enrolment_hash": {
"name": "passkey_enrolment_hash",
"type": "text",
"primaryKey": false,
"notNull": false
},
"passkey_enrolment_expires_at": {
"name": "passkey_enrolment_expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"user_email_unique": {
"name": "user_email_unique",
"columns": [
"email"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.verification": {
"name": "verification",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"identifier": {
"name": "identifier",
"type": "text",
"primaryKey": false,
"notNull": true
},
"value": {
"name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"verification_identifier_idx": {
"name": "verification_identifier_idx",
"columns": [
{
"expression": "identifier",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"views": {},
"sequences": {
"public.row_version": {
"name": "row_version",
"increment": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"startWith": "1",
"cache": "1",
"cycle": false,
"schema": "public"
}
},
"roles": {},
"policies": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}