{
  "id": "4c028e63-565c-451a-a7fb-2be418343d32",
  "prevId": "c6cda363-b589-41ee-aa55-96f03d899f5c",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.auth_tokens": {
      "name": "auth_tokens",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "auth_tokens_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "purpose": {
          "name": "purpose",
          "type": "auth_token_purpose",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "token_hash": {
          "name": "token_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "used_at": {
          "name": "used_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": {},
      "foreignKeys": {
        "auth_tokens_user_id_users_id_fk": {
          "name": "auth_tokens_user_id_users_id_fk",
          "tableFrom": "auth_tokens",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.event_attendees": {
      "name": "event_attendees",
      "schema": "",
      "columns": {
        "event_id": {
          "name": "event_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "attendee_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'needs_action'"
        },
        "responded_at": {
          "name": "responded_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": {
        "event_attendees_pk": {
          "name": "event_attendees_pk",
          "columns": [
            {
              "expression": "event_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "event_attendees_user_idx": {
          "name": "event_attendees_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "event_attendees_event_id_events_id_fk": {
          "name": "event_attendees_event_id_events_id_fk",
          "tableFrom": "event_attendees",
          "tableTo": "events",
          "columnsFrom": [
            "event_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "event_attendees_user_id_users_id_fk": {
          "name": "event_attendees_user_id_users_id_fk",
          "tableFrom": "event_attendees",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.events": {
      "name": "events",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "events_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "workspace_id": {
          "name": "workspace_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "location": {
          "name": "location",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "starts_at": {
          "name": "starts_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "ends_at": {
          "name": "ends_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "all_day": {
          "name": "all_day",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "timezone": {
          "name": "timezone",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'UTC'"
        },
        "recurrence_rule": {
          "name": "recurrence_rule",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_by": {
          "name": "created_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "parent_event_id": {
          "name": "parent_event_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "occurrence_date": {
          "name": "occurrence_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false
        },
        "is_cancelled": {
          "name": "is_cancelled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "events_workspace_starts_idx": {
          "name": "events_workspace_starts_idx",
          "columns": [
            {
              "expression": "workspace_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "starts_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "events_parent_occurrence_idx": {
          "name": "events_parent_occurrence_idx",
          "columns": [
            {
              "expression": "parent_event_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "occurrence_date",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "events_channel_idx": {
          "name": "events_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "events_workspace_id_workspaces_id_fk": {
          "name": "events_workspace_id_workspaces_id_fk",
          "tableFrom": "events",
          "tableTo": "workspaces",
          "columnsFrom": [
            "workspace_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "events_channel_id_channels_id_fk": {
          "name": "events_channel_id_channels_id_fk",
          "tableFrom": "events",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "events_created_by_users_id_fk": {
          "name": "events_created_by_users_id_fk",
          "tableFrom": "events",
          "tableTo": "users",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "events_parent_event_id_events_id_fk": {
          "name": "events_parent_event_id_events_id_fk",
          "tableFrom": "events",
          "tableTo": "events",
          "columnsFrom": [
            "parent_event_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.call_participants": {
      "name": "call_participants",
      "schema": "",
      "columns": {
        "call_id": {
          "name": "call_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "state": {
          "name": "state",
          "type": "call_participant_state",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'ringing'"
        },
        "invited_at": {
          "name": "invited_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "joined_at": {
          "name": "joined_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "left_at": {
          "name": "left_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "seen_at": {
          "name": "seen_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "call_participants_pk": {
          "name": "call_participants_pk",
          "columns": [
            {
              "expression": "call_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "call_participants_user_idx": {
          "name": "call_participants_user_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "state",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "call_participants_call_id_calls_id_fk": {
          "name": "call_participants_call_id_calls_id_fk",
          "tableFrom": "call_participants",
          "tableTo": "calls",
          "columnsFrom": [
            "call_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "call_participants_user_id_users_id_fk": {
          "name": "call_participants_user_id_users_id_fk",
          "tableFrom": "call_participants",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.calls": {
      "name": "calls",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "calls_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "workspace_id": {
          "name": "workspace_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "kind": {
          "name": "kind",
          "type": "call_kind",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'audio'"
        },
        "status": {
          "name": "status",
          "type": "call_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'ringing'"
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "event_id": {
          "name": "event_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "started_by": {
          "name": "started_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "answered_at": {
          "name": "answered_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "ended_at": {
          "name": "ended_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "calls_workspace_started_idx": {
          "name": "calls_workspace_started_idx",
          "columns": [
            {
              "expression": "workspace_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "started_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "calls_workspace_status_idx": {
          "name": "calls_workspace_status_idx",
          "columns": [
            {
              "expression": "workspace_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "calls_channel_idx": {
          "name": "calls_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "calls_workspace_id_workspaces_id_fk": {
          "name": "calls_workspace_id_workspaces_id_fk",
          "tableFrom": "calls",
          "tableTo": "workspaces",
          "columnsFrom": [
            "workspace_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "calls_channel_id_channels_id_fk": {
          "name": "calls_channel_id_channels_id_fk",
          "tableFrom": "calls",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "calls_event_id_events_id_fk": {
          "name": "calls_event_id_events_id_fk",
          "tableFrom": "calls",
          "tableTo": "events",
          "columnsFrom": [
            "event_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "calls_started_by_users_id_fk": {
          "name": "calls_started_by_users_id_fk",
          "tableFrom": "calls",
          "tableTo": "users",
          "columnsFrom": [
            "started_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.channel_integrations": {
      "name": "channel_integrations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "channel_integrations_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "provider": {
          "name": "provider",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "label": {
          "name": "label",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "external_url": {
          "name": "external_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "added_by": {
          "name": "added_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "added_at": {
          "name": "added_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "channel_integrations_channel_provider_idx": {
          "name": "channel_integrations_channel_provider_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "provider",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "channel_integrations_channel_id_channels_id_fk": {
          "name": "channel_integrations_channel_id_channels_id_fk",
          "tableFrom": "channel_integrations",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "channel_integrations_added_by_users_id_fk": {
          "name": "channel_integrations_added_by_users_id_fk",
          "tableFrom": "channel_integrations",
          "tableTo": "users",
          "columnsFrom": [
            "added_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.channel_members": {
      "name": "channel_members",
      "schema": "",
      "columns": {
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'member'"
        },
        "joined_at": {
          "name": "joined_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "last_read_seq": {
          "name": "last_read_seq",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "last_read_at": {
          "name": "last_read_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "mention_count": {
          "name": "mention_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "notif_pref": {
          "name": "notif_pref",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'all'"
        },
        "is_muted": {
          "name": "is_muted",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "is_starred": {
          "name": "is_starred",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "section_id": {
          "name": "section_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "channel_members_pk": {
          "name": "channel_members_pk",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "channel_members_channel_id_channels_id_fk": {
          "name": "channel_members_channel_id_channels_id_fk",
          "tableFrom": "channel_members",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "channel_members_user_id_users_id_fk": {
          "name": "channel_members_user_id_users_id_fk",
          "tableFrom": "channel_members",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.channel_seq": {
      "name": "channel_seq",
      "schema": "",
      "columns": {
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true
        },
        "last_seq": {
          "name": "last_seq",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        }
      },
      "indexes": {},
      "foreignKeys": {
        "channel_seq_channel_id_channels_id_fk": {
          "name": "channel_seq_channel_id_channels_id_fk",
          "tableFrom": "channel_seq",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.channels": {
      "name": "channels",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "channels_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "workspace_id": {
          "name": "workspace_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "channel_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "topic": {
          "name": "topic",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "purpose": {
          "name": "purpose",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_by": {
          "name": "created_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "is_archived": {
          "name": "is_archived",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "last_message_at": {
          "name": "last_message_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "member_count": {
          "name": "member_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "channels_workspace_id_workspaces_id_fk": {
          "name": "channels_workspace_id_workspaces_id_fk",
          "tableFrom": "channels",
          "tableTo": "workspaces",
          "columnsFrom": [
            "workspace_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "channels_created_by_users_id_fk": {
          "name": "channels_created_by_users_id_fk",
          "tableFrom": "channels",
          "tableTo": "users",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.invites": {
      "name": "invites",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "invites_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "workspace_id": {
          "name": "workspace_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "invited_by_user_id": {
          "name": "invited_by_user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "token_hash": {
          "name": "token_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "role",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'member'"
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "used_at": {
          "name": "used_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "max_uses": {
          "name": "max_uses",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 1
        },
        "use_count": {
          "name": "use_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "invites_workspace_id_workspaces_id_fk": {
          "name": "invites_workspace_id_workspaces_id_fk",
          "tableFrom": "invites",
          "tableTo": "workspaces",
          "columnsFrom": [
            "workspace_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "invites_invited_by_user_id_users_id_fk": {
          "name": "invites_invited_by_user_id_users_id_fk",
          "tableFrom": "invites",
          "tableTo": "users",
          "columnsFrom": [
            "invited_by_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.notifications": {
      "name": "notifications",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "notifications_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "body": {
          "name": "body",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "payload": {
          "name": "payload",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'{}'::jsonb"
        },
        "read_at": {
          "name": "read_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": {},
      "foreignKeys": {
        "notifications_user_id_users_id_fk": {
          "name": "notifications_user_id_users_id_fk",
          "tableFrom": "notifications",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.organizations": {
      "name": "organizations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "organizations_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "plan": {
          "name": "plan",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'free'"
        },
        "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.scheduled_statuses": {
      "name": "scheduled_statuses",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "scheduled_statuses_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "workspace_id": {
          "name": "workspace_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "text": {
          "name": "text",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "emoji": {
          "name": "emoji",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'💬'"
        },
        "starts_at": {
          "name": "starts_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "ends_at": {
          "name": "ends_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "pause_notifications": {
          "name": "pause_notifications",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "scheduled_statuses_user_start_idx": {
          "name": "scheduled_statuses_user_start_idx",
          "columns": [
            {
              "expression": "workspace_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "starts_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "scheduled_statuses_workspace_id_workspaces_id_fk": {
          "name": "scheduled_statuses_workspace_id_workspaces_id_fk",
          "tableFrom": "scheduled_statuses",
          "tableTo": "workspaces",
          "columnsFrom": [
            "workspace_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "scheduled_statuses_user_id_users_id_fk": {
          "name": "scheduled_statuses_user_id_users_id_fk",
          "tableFrom": "scheduled_statuses",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sessions": {
      "name": "sessions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "sessions_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "refresh_token_hash": {
          "name": "refresh_token_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "device_label": {
          "name": "device_label",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "ip": {
          "name": "ip",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "rotated_from": {
          "name": "rotated_from",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "revoked_at": {
          "name": "revoked_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "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": {
        "sessions_user_id_users_id_fk": {
          "name": "sessions_user_id_users_id_fk",
          "tableFrom": "sessions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.users": {
      "name": "users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "users_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email_verified_at": {
          "name": "email_verified_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "password_hash": {
          "name": "password_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "username": {
          "name": "username",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "avatar_url": {
          "name": "avatar_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "tz": {
          "name": "tz",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'UTC'"
        },
        "mfa_secret": {
          "name": "mfa_secret",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "users_email_idx": {
          "name": "users_email_idx",
          "columns": [
            {
              "expression": "email",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "users_username_idx": {
          "name": "users_username_idx",
          "columns": [
            {
              "expression": "username",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.workspace_members": {
      "name": "workspace_members",
      "schema": "",
      "columns": {
        "workspace_id": {
          "name": "workspace_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "role",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'member'"
        },
        "display_name": {
          "name": "display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status_text": {
          "name": "status_text",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status_emoji": {
          "name": "status_emoji",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status_expires_at": {
          "name": "status_expires_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "availability_mode": {
          "name": "availability_mode",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'auto'"
        },
        "dnd_enabled": {
          "name": "dnd_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "dnd_until": {
          "name": "dnd_until",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "auto_status_huddle": {
          "name": "auto_status_huddle",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "auto_status_focus": {
          "name": "auto_status_focus",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "auto_status_outside_hours": {
          "name": "auto_status_outside_hours",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "focus_mode_enabled": {
          "name": "focus_mode_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "in_huddle": {
          "name": "in_huddle",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "work_hours_start": {
          "name": "work_hours_start",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'09:00'"
        },
        "work_hours_end": {
          "name": "work_hours_end",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'17:00'"
        },
        "working_days": {
          "name": "working_days",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'[1,2,3,4,5]'::jsonb"
        },
        "joined_at": {
          "name": "joined_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "deactivated_at": {
          "name": "deactivated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "workspace_members_pk": {
          "name": "workspace_members_pk",
          "columns": [
            {
              "expression": "workspace_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "workspace_members_workspace_id_workspaces_id_fk": {
          "name": "workspace_members_workspace_id_workspaces_id_fk",
          "tableFrom": "workspace_members",
          "tableTo": "workspaces",
          "columnsFrom": [
            "workspace_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "workspace_members_user_id_users_id_fk": {
          "name": "workspace_members_user_id_users_id_fk",
          "tableFrom": "workspace_members",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.workspaces": {
      "name": "workspaces",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "workspaces_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "org_id": {
          "name": "org_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "icon_url": {
          "name": "icon_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "settings": {
          "name": "settings",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'{}'::jsonb"
        },
        "retention_days": {
          "name": "retention_days",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "workspaces_slug_idx": {
          "name": "workspaces_slug_idx",
          "columns": [
            {
              "expression": "slug",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "workspaces_org_id_organizations_id_fk": {
          "name": "workspaces_org_id_organizations_id_fk",
          "tableFrom": "workspaces",
          "tableTo": "organizations",
          "columnsFrom": [
            "org_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.message_mentions": {
      "name": "message_mentions",
      "schema": "",
      "columns": {
        "message_id": {
          "name": "message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "target_type": {
          "name": "target_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "target_id": {
          "name": "target_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "message_mentions_message_id_messages_id_fk": {
          "name": "message_mentions_message_id_messages_id_fk",
          "tableFrom": "message_mentions",
          "tableTo": "messages",
          "columnsFrom": [
            "message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.messages": {
      "name": "messages",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "messages_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "workspace_id": {
          "name": "workspace_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "seq": {
          "name": "seq",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true
        },
        "client_msg_id": {
          "name": "client_msg_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "author_id": {
          "name": "author_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'text'"
        },
        "text": {
          "name": "text",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "blocks": {
          "name": "blocks",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "revision": {
          "name": "revision",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "parent_id": {
          "name": "parent_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "is_broadcast": {
          "name": "is_broadcast",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "thread_reply_count": {
          "name": "thread_reply_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "thread_last_reply_at": {
          "name": "thread_last_reply_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "edited_at": {
          "name": "edited_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "deleted_at": {
          "name": "deleted_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": {
        "messages_channel_seq_idx": {
          "name": "messages_channel_seq_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "seq",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "messages_channel_client_msg_idx": {
          "name": "messages_channel_client_msg_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "client_msg_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "messages_workspace_id_workspaces_id_fk": {
          "name": "messages_workspace_id_workspaces_id_fk",
          "tableFrom": "messages",
          "tableTo": "workspaces",
          "columnsFrom": [
            "workspace_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "messages_channel_id_channels_id_fk": {
          "name": "messages_channel_id_channels_id_fk",
          "tableFrom": "messages",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "messages_author_id_users_id_fk": {
          "name": "messages_author_id_users_id_fk",
          "tableFrom": "messages",
          "tableTo": "users",
          "columnsFrom": [
            "author_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.pins": {
      "name": "pins",
      "schema": "",
      "columns": {
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "message_id": {
          "name": "message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "pinned_by": {
          "name": "pinned_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "pinned_at": {
          "name": "pinned_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "pins_pk": {
          "name": "pins_pk",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "message_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "pins_channel_id_channels_id_fk": {
          "name": "pins_channel_id_channels_id_fk",
          "tableFrom": "pins",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "pins_message_id_messages_id_fk": {
          "name": "pins_message_id_messages_id_fk",
          "tableFrom": "pins",
          "tableTo": "messages",
          "columnsFrom": [
            "message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "pins_pinned_by_users_id_fk": {
          "name": "pins_pinned_by_users_id_fk",
          "tableFrom": "pins",
          "tableTo": "users",
          "columnsFrom": [
            "pinned_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.reactions": {
      "name": "reactions",
      "schema": "",
      "columns": {
        "message_id": {
          "name": "message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "emoji": {
          "name": "emoji",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "reactions_pk": {
          "name": "reactions_pk",
          "columns": [
            {
              "expression": "message_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "emoji",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "reactions_message_id_messages_id_fk": {
          "name": "reactions_message_id_messages_id_fk",
          "tableFrom": "reactions",
          "tableTo": "messages",
          "columnsFrom": [
            "message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "reactions_user_id_users_id_fk": {
          "name": "reactions_user_id_users_id_fk",
          "tableFrom": "reactions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.thread_subscriptions": {
      "name": "thread_subscriptions",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "root_message_id": {
          "name": "root_message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "workspace_id": {
          "name": "workspace_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "last_read_reply_seq": {
          "name": "last_read_reply_seq",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "reason": {
          "name": "reason",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "is_muted": {
          "name": "is_muted",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "subscribed_at": {
          "name": "subscribed_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "thread_subscriptions_pk": {
          "name": "thread_subscriptions_pk",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "root_message_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "thread_subscriptions_user_id_users_id_fk": {
          "name": "thread_subscriptions_user_id_users_id_fk",
          "tableFrom": "thread_subscriptions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "thread_subscriptions_root_message_id_messages_id_fk": {
          "name": "thread_subscriptions_root_message_id_messages_id_fk",
          "tableFrom": "thread_subscriptions",
          "tableTo": "messages",
          "columnsFrom": [
            "root_message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "thread_subscriptions_channel_id_channels_id_fk": {
          "name": "thread_subscriptions_channel_id_channels_id_fk",
          "tableFrom": "thread_subscriptions",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "thread_subscriptions_workspace_id_workspaces_id_fk": {
          "name": "thread_subscriptions_workspace_id_workspaces_id_fk",
          "tableFrom": "thread_subscriptions",
          "tableTo": "workspaces",
          "columnsFrom": [
            "workspace_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.tasks": {
      "name": "tasks",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "identity": {
            "type": "byDefault",
            "name": "tasks_id_seq",
            "schema": "public",
            "increment": "1",
            "startWith": "1",
            "minValue": "1",
            "maxValue": "2147483647",
            "cache": "1",
            "cycle": false
          }
        },
        "workspace_id": {
          "name": "workspace_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "task_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'todo'"
        },
        "assignee_user_id": {
          "name": "assignee_user_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "due_at": {
          "name": "due_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "created_by": {
          "name": "created_by",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "channel_id": {
          "name": "channel_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "source_message_id": {
          "name": "source_message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "completed_at": {
          "name": "completed_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()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "tasks_workspace_status_idx": {
          "name": "tasks_workspace_status_idx",
          "columns": [
            {
              "expression": "workspace_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "tasks_assignee_idx": {
          "name": "tasks_assignee_idx",
          "columns": [
            {
              "expression": "assignee_user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "tasks_due_at_idx": {
          "name": "tasks_due_at_idx",
          "columns": [
            {
              "expression": "due_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "tasks_channel_idx": {
          "name": "tasks_channel_idx",
          "columns": [
            {
              "expression": "channel_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "tasks_workspace_id_workspaces_id_fk": {
          "name": "tasks_workspace_id_workspaces_id_fk",
          "tableFrom": "tasks",
          "tableTo": "workspaces",
          "columnsFrom": [
            "workspace_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "tasks_assignee_user_id_users_id_fk": {
          "name": "tasks_assignee_user_id_users_id_fk",
          "tableFrom": "tasks",
          "tableTo": "users",
          "columnsFrom": [
            "assignee_user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "tasks_created_by_users_id_fk": {
          "name": "tasks_created_by_users_id_fk",
          "tableFrom": "tasks",
          "tableTo": "users",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "tasks_channel_id_channels_id_fk": {
          "name": "tasks_channel_id_channels_id_fk",
          "tableFrom": "tasks",
          "tableTo": "channels",
          "columnsFrom": [
            "channel_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "tasks_source_message_id_messages_id_fk": {
          "name": "tasks_source_message_id_messages_id_fk",
          "tableFrom": "tasks",
          "tableTo": "messages",
          "columnsFrom": [
            "source_message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {
    "public.auth_token_purpose": {
      "name": "auth_token_purpose",
      "schema": "public",
      "values": [
        "email_verify",
        "password_reset",
        "magic_link"
      ]
    },
    "public.attendee_status": {
      "name": "attendee_status",
      "schema": "public",
      "values": [
        "needs_action",
        "going",
        "maybe",
        "declined"
      ]
    },
    "public.call_kind": {
      "name": "call_kind",
      "schema": "public",
      "values": [
        "audio",
        "video"
      ]
    },
    "public.call_participant_state": {
      "name": "call_participant_state",
      "schema": "public",
      "values": [
        "ringing",
        "joined",
        "left",
        "declined",
        "missed"
      ]
    },
    "public.call_status": {
      "name": "call_status",
      "schema": "public",
      "values": [
        "ringing",
        "active",
        "ended",
        "missed"
      ]
    },
    "public.channel_type": {
      "name": "channel_type",
      "schema": "public",
      "values": [
        "public",
        "private",
        "dm",
        "group_dm"
      ]
    },
    "public.role": {
      "name": "role",
      "schema": "public",
      "values": [
        "owner",
        "admin",
        "member",
        "multi_channel_guest",
        "single_channel_guest",
        "bot"
      ]
    },
    "public.task_status": {
      "name": "task_status",
      "schema": "public",
      "values": [
        "todo",
        "in_progress",
        "done"
      ]
    }
  },
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}