<?xml version="1.0" encoding="UTF-8"?><database name="schemaspy" schema="public" type="PostgreSQL - 16.11">
   <sequences>
      <sequence increment="1" name="account_id_seq" startValue="1"/>
      <sequence increment="1" name="account_logs_id_seq" startValue="1"/>
      <sequence increment="1" name="action_api_id_seq" startValue="1"/>
      <sequence increment="1" name="action_id_seq" startValue="1"/>
      <sequence increment="1" name="billing_account_id_seq" startValue="1"/>
      <sequence increment="1" name="common_settings_id_seq" startValue="1"/>
      <sequence increment="1" name="custom_date_settings_rule_condition_id_seq" startValue="1"/>
      <sequence increment="1" name="custom_date_settings_rule_id_seq" startValue="1"/>
      <sequence increment="1" name="custom_widget_client_id_seq" startValue="1"/>
      <sequence increment="1" name="custom_widget_id_seq" startValue="1"/>
      <sequence increment="1" name="external_type_permission_values_id_seq" startValue="1"/>
      <sequence increment="1" name="integration_id_seq" startValue="1"/>
      <sequence increment="1" name="keycloak_domains_id_seq" startValue="1"/>
      <sequence increment="1" name="method_id_seq" startValue="1"/>
      <sequence increment="1" name="role_action_id_seq" startValue="1"/>
      <sequence increment="1" name="role_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_category_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_edit_all_values_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_element_types_edit_dictionary_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_element_types_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_element_types_view_dictionary_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_rule_all_values_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_rule_edit_all_values_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_rule_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_rule_permission_action_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_rule_permission_all_values_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_rule_permission_id_seq" startValue="1"/>
      <sequence increment="1" name="security_policy_rule_value_id_seq" startValue="1"/>
      <sequence increment="1" name="telephony_account_id_seq" startValue="1"/>
      <sequence increment="1" name="telephony_user_id_seq" startValue="1"/>
      <sequence increment="1" name="user_id_seq" startValue="1"/>
      <sequence increment="1" name="user_session_id_seq" startValue="1"/>
   </sequences>
   <tables>
      <table name="account" numRows="5" remarks="Таблица соответсвий clid\домен амо\домен клиента" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <child column="account_id" foreignKey="fk_account_logs_account" implied="false" onDeleteCascade="true" schema="public" table="account_logs"/>
            <child column="account_id" foreignKey="fk_common_settings_account_id" implied="false" onDeleteCascade="true" schema="public" table="common_settings"/>
            <child column="account_id" foreignKey="fk_b9d5b9a69b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="custom_widget_client"/>
            <child column="account_id" foreignKey="fk_57698a6a9b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="role"/>
            <child column="account_id" foreignKey="fk_6fe071439b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_permission"/>
            <child column="account_id" foreignKey="fk_3a0a68a29b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="telephony_account"/>
            <child column="account_id" foreignKey="fk_8d93d6499b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="user"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="clid" nullable="false" remarks="Внутренний (от интроверта) идентификатор клиента" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="amo_domain" nullable="false" remarks="Домен amocrm" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="amoee_domain" nullable="false" remarks="Домен amoee" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="amo_id" nullable="false" remarks="Идентификатор аккаунт amoCRM в виде числа" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="billing_account_id" nullable="false" remarks="id клиента из таблицы billing_account связь ManyToOne" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_7d3656a4170c302b" implied="false" onDeleteCascade="false" schema="public" table="billing_account"/>
         </column>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="6" name="replica_domain" nullable="true" remarks="Домен api-hub для аккаунта" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="7" name="replica_key" nullable="true" remarks="Ключ api-hub для аккаунта" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="replica_db_port" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="9" name="replica_db_name" nullable="true" remarks="" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="10" name="replica_db_user" nullable="true" remarks="" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="replica_db_password" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="12" name="replica_db_host" nullable="true" remarks="" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="pdbox_database_url" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="account_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_7d3656a4170c302b" unique="false">
            <column ascending="true" name="billing_account_id"/>
         </index>
      </table>
      <table name="account_logs" numRows="1" remarks="OpenSearch dashboard configuration for alerts" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('account_logs_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="account_id" nullable="false" remarks="Foreign key to account table (OneToOne)" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_account_logs_account" implied="false" onDeleteCascade="true" schema="public" table="account"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="opensearch_data" nullable="false" remarks="JSON with dashboard_url, filter_index_id, controlled_by_id, expanded_panel_ids" size="2147483647" type="json" typeCode="1111"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="account_logs_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="uq_account_logs_account_id" unique="true">
            <column ascending="true" name="account_id"/>
         </index>
      </table>
      <table name="action" numRows="29" remarks="Таблица проверяемых урлов на право доступа" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('action_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4">
            <child column="action_id" foreignKey="role_action_action_id_fkey" implied="false" onDeleteCascade="false" schema="public" table="role_action"/>
            <child column="action_id" foreignKey="fk_40f3fa1b9d32f035" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_permission_action"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="method_id" nullable="false" remarks="id метода, связь с таблицей method" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_47cc8c9219883967" implied="false" onDeleteCascade="false" schema="public" table="method"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="name" nullable="false" remarks="Название активности (запроса)" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="url" nullable="false" remarks="URL активности (запроса)" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="is_active" nullable="true" remarks="Параметр включение\выключения активности" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="400" digits="0" id="5" name="response_code" nullable="false" remarks="Код сообщения об ошибке" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="'Error'::character varying" digits="0" id="6" name="response_message" nullable="false" remarks="Текст сообщения об ошибке" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="7" name="cache_ttl" nullable="false" remarks="TTL кеширования ответа в секундах. 0 - кеширование выключено." size="10" type="int4" typeCode="4"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="action_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_47cc8c9219883967" unique="false">
            <column ascending="true" name="method_id"/>
         </index>
         <index name="uniq_action_method_url" unique="true">
            <column ascending="true" name="method_id"/>
            <column ascending="true" name="url"/>
         </index>
      </table>
      <table name="action_api" numRows="8" remarks="Таблица API-действий с уникальной комбинацией метода и URL" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('action_api_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="автоинкрементный идентификатор записи в таблице" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="method_id" nullable="false" remarks="ссылка на таблицу &quot;method&quot; (GET/POST/PUT/PATCH и т.д.)" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_action_api_method" implied="false" onDeleteCascade="false" schema="public" table="method"/>
         </column>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="2" name="name" nullable="true" remarks="название действия (может быть пустым)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="url" nullable="false" remarks="URL действия" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="4" name="is_active" nullable="false" remarks="флаг активности действия" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="service_class" nullable="false" remarks="класс для обработки запроса" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="action_api_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="action_api_method_url_unique" unique="true">
            <column ascending="true" name="method_id"/>
            <column ascending="true" name="url"/>
         </index>
      </table>
      <table name="amo_market_allowed_widgets" numRows="552" remarks="Таблица виджетов, разрешённых в amo-маркете" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="code" nullable="false" remarks="Код виджета" size="255" type="varchar" typeCode="12">
            <child column="code" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="security_policy_category"/>
            <child column="code" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="security_policy_rule"/>
            <child column="code" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="security_policy_rule_permission"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="Название виджета" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="code" sequenceNumberInPK="1"/>
         <index name="amo_market_allowed_widgets_pkey" unique="true">
            <column ascending="true" name="code"/>
         </index>
      </table>
      <table name="billing_account" numRows="3" remarks="Таблица с информацией о клиентах" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <child column="billing_account_id" foreignKey="fk_7d3656a4170c302b" implied="false" onDeleteCascade="false" schema="public" table="account"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="Наименование клиента" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="2" name="description" nullable="true" remarks="Описание клиента" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="billing_account_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="common_settings" numRows="9" remarks="Таблица общих настроек приложения" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('common_settings_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="Идентификатор настройки" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="Название настройки" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="description" nullable="true" remarks="Описание настройки" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="settings" nullable="true" remarks="Json с настройками" size="2147483647" type="json" typeCode="1111"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="account_id" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_common_settings_account_id" implied="false" onDeleteCascade="true" schema="public" table="account"/>
         </column>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="common_settings_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_common_settings_account_id" unique="false">
            <column ascending="true" name="account_id"/>
         </index>
         <index name="uniq_common_settings_name_account" unique="true">
            <column ascending="true" name="name"/>
            <column ascending="true" name="account_id"/>
         </index>
      </table>
      <table name="custom_date_settings_rule" numRows="7" remarks="Таблица с правилами валидации полей с типом даты" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="автоинкрементный идентификатор записи в таблице" size="10" type="int4" typeCode="4">
            <child column="custom_date_settings_rule_id" foreignKey="fk_14380fca36fb85a9" implied="false" onDeleteCascade="false" schema="public" table="custom_date_settings_rule_condition"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="role_id" nullable="false" remarks="идентификатор записи в таблице &quot;role&quot; (ссылка)" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_cafe2b4bd60322ac" implied="false" onDeleteCascade="false" schema="public" table="role"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="amo_field_id" nullable="false" remarks="id поля в Амо с типом &quot;дата&quot; или &quot;дата/время&quot;" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="pipeline_status" nullable="true" remarks="список этапов воронок (123_234|345_456|567_678...)" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="is_and_operator" nullable="false" remarks="флаг операторов сравнения &quot;И/ИЛИ&quot; (&quot;И&quot; - true; &quot;ИЛИ&quot; - false)" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="error_message" nullable="true" remarks="текст сообщения об ошибке" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="is_active" nullable="false" remarks="флаг активности правила (правило работает - true, правило не работает - false)" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="'keep_current'::character varying" digits="0" id="7" name="value_behavior_type" nullable="false" remarks="Поведение валидируемого значения при ошибке (&quot;keep_current&quot; - значение остаётся, поле подсвечивается красным, под ним появляется текст с ошибкой; &quot;return_value&quot; - поле возвращает предыдущее значение, появляется модалка с ошибкой)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="'date'::character varying" digits="0" id="8" name="field_type" nullable="false" remarks="тип проверяемого поля (&quot;date&quot;, &quot;text&quot;, &quot;numeric&quot;, &quot;select&quot; и т.д., как в Амо)" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="custom_date_settings_rule_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_cafe2b4bd60322ac" unique="false">
            <column ascending="true" name="role_id"/>
         </index>
      </table>
      <table name="custom_date_settings_rule_condition" numRows="8" remarks="Таблица с условиями проверок для правил валидации полей с типом даты" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="автоинкрементный идентификатор записи в таблице" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="custom_date_settings_rule_id" nullable="false" remarks="идентификатор записи в таблице &quot;custom_date_settings_rule&quot; (ссылка)" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_14380fca36fb85a9" implied="false" onDeleteCascade="false" schema="public" table="custom_date_settings_rule"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="period_value" nullable="true" remarks="значение проверяемого периода в днях, если предусмотрено" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="date_value" nullable="true" remarks="значение проверяемой даты, если предусмотрено (2025-03-31)" size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="amo_field_id" nullable="true" remarks="id проверяемого поля в Амо с типом &quot;дата&quot; или &quot;дата/время&quot;, если предусмотрено" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="custom_date_settings_rule_condition_type_check_type_id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_14380fcae2fc2f8c" implied="false" onDeleteCascade="false" schema="public" table="custom_date_settings_rule_condition_type_check_type"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="amo_other_field_id" nullable="true" remarks="id поля в Амо для стороннего сравнения" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="7" name="other_value" nullable="true" remarks="значение поля amo_other_field_id для стороннего сравнения (может быть конкретным значением или содержать id поля Амо, со значением которого сравнивается)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="8" name="field_value" nullable="true" remarks="значение проверяемого поля, если предусмотрено" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="custom_date_settings_rule_condition_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_14380fca36fb85a9" unique="false">
            <column ascending="true" name="custom_date_settings_rule_id"/>
         </index>
         <index name="idx_14380fcae2fc2f8c" unique="false">
            <column ascending="true" name="custom_date_settings_rule_condition_type_check_type_id"/>
         </index>
      </table>
      <table name="custom_date_settings_rule_condition_type" numRows="10" remarks="Справочник типов условий, по которым мы умеем сравнивать" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="идентификатор записи в таблице (не автоинкрементный)" size="10" type="int4" typeCode="4">
            <child column="custom_date_settings_rule_condition_type_id" foreignKey="fk_370fe610d163f27a" implied="false" onDeleteCascade="false" schema="public" table="custom_date_settings_rule_condition_type_check_type"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="наименование типа условия на латинице в snake case (тип_поля_(поле_в_амо|фиксированное|текущее) - прим. &quot;date_fixed&quot;)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="description" nullable="false" remarks="короткое описание типа условия на человеческом языке (прим. &quot;Конкретно указанная дата&quot;)" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="custom_date_settings_rule_condition_type_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="uniq_2eeba4635e237e06" unique="true">
            <column ascending="true" name="name"/>
         </index>
      </table>
      <table name="custom_date_settings_rule_condition_type_check_type" numRows="42" remarks="Справочник проверок для типа условий" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="идентификатор записи в таблице (не автоинкрементный)" size="10" type="int4" typeCode="4">
            <child column="custom_date_settings_rule_condition_type_check_type_id" foreignKey="fk_14380fcae2fc2f8c" implied="false" onDeleteCascade="false" schema="public" table="custom_date_settings_rule_condition"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="custom_date_settings_rule_condition_type_id" nullable="false" remarks="идентификатор записи в таблице &quot;custom_date_settings_rule_condition_type&quot; (ссылка)" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_370fe610d163f27a" implied="false" onDeleteCascade="false" schema="public" table="custom_date_settings_rule_condition_type"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="custom_date_settings_rule_condition_type_check_type_logic_id" nullable="false" remarks="идентификатор записи в таблице &quot;custom_date_settings_rule_condition_type_check_type_logic&quot; (ссылка)" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_370fe6108650548b" implied="false" onDeleteCascade="false" schema="public" table="custom_date_settings_rule_condition_type_check_type_logic"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="description" nullable="false" remarks="короткое описание проверки для типа условия на человеческом языке (прим. &quot;Текущая дата плюс период&quot;)" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="custom_date_settings_rule_condition_type_check_type_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_370fe6108650548b" unique="false">
            <column ascending="true" name="custom_date_settings_rule_condition_type_check_type_logic_id"/>
         </index>
         <index name="idx_370fe610d163f27a" unique="false">
            <column ascending="true" name="custom_date_settings_rule_condition_type_id"/>
         </index>
         <index name="uniq_370fe610d163f27a8650548b" unique="true">
            <column ascending="true" name="custom_date_settings_rule_condition_type_id"/>
            <column ascending="true" name="custom_date_settings_rule_condition_type_check_type_logic_id"/>
         </index>
      </table>
      <table name="custom_date_settings_rule_condition_type_check_type_logic" numRows="14" remarks="Справочник возможных логических операций для проверок по типам условий" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="идентификатор записи в таблице (не автоинкрементный)" size="10" type="int4" typeCode="4">
            <child column="custom_date_settings_rule_condition_type_check_type_logic_id" foreignKey="fk_370fe6108650548b" implied="false" onDeleteCascade="false" schema="public" table="custom_date_settings_rule_condition_type_check_type"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="наименование логической операции на латинице в snake case (прим. &quot;greater_or_equal&quot;)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="description" nullable="false" remarks="короткое описание логики на человеческом языке (прим. &quot;Проверяемое значение больше или равно исходному&quot;)" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="custom_date_settings_rule_condition_type_check_type_logic_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="uniq_838488965e237e06" unique="true">
            <column ascending="true" name="name"/>
         </index>
      </table>
      <table name="custom_widget" numRows="13" remarks="Таблица со списком кастомов" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="автоинкрементный идентификатор записи в таблице" size="10" type="int4" typeCode="4">
            <child column="custom_widget_id" foreignKey="fk_b9d5b9a6b1d2f244" implied="false" onDeleteCascade="false" schema="public" table="custom_widget_client"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="название кастома на латинице в snake case" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="custom_widget_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="uniq_b154cad45e237e06" unique="true">
            <column ascending="true" name="name"/>
         </index>
      </table>
      <table name="custom_widget_client" numRows="13" remarks="Таблица со списком клиентов кастомов" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="автоинкрементный идентификатор записи в таблице" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="custom_widget_id" nullable="false" remarks="идентификатор записи в таблице &quot;custom_widget&quot; (ссылка)" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_b9d5b9a6b1d2f244" implied="false" onDeleteCascade="false" schema="public" table="custom_widget"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="account_id" nullable="false" remarks="идентификатор записи в таблице &quot;account&quot; (ссылка)" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_b9d5b9a69b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="account"/>
         </column>
         <column autoUpdated="false" defaultValue="false" digits="0" id="3" name="is_active" nullable="false" remarks="флаг активности кастома для клиента" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="custom_settings" nullable="true" remarks="Настройки кастома для аккаунта в json-формате" size="2147483647" type="json" typeCode="1111"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="custom_widget_client_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_b9d5b9a69b6b5fba" unique="false">
            <column ascending="true" name="account_id"/>
         </index>
         <index name="idx_b9d5b9a6b1d2f244" unique="false">
            <column ascending="true" name="custom_widget_id"/>
         </index>
         <index name="uniq_b9d5b9a6b1d2f2449b6b5fba" unique="true">
            <column ascending="true" name="custom_widget_id"/>
            <column ascending="true" name="account_id"/>
         </index>
      </table>
      <table name="doctrine_migration_versions" numRows="109" remarks="" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="version" nullable="false" remarks="" size="191" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::timestamp without time zone" digits="0" id="1" name="executed_at" nullable="true" remarks="" size="22" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="execution_time" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <primaryKey column="version" sequenceNumberInPK="1"/>
         <index name="doctrine_migration_versions_pkey" unique="true">
            <column ascending="true" name="version"/>
         </index>
      </table>
      <table name="external_type_permission_values" numRows="17" remarks="Справочник возможных значений в типизированных выпадающих списках." schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="security_policy_rule_permission_all_values_id" nullable="true" remarks="Ссылка на возможное значение" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_2cb9e979a492a00d" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_view_all_values"/>
         </column>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="2" name="external_type_id" nullable="true" remarks="Тип и принадлежность сущности" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="3" name="is_default" nullable="false" remarks="Флаг значения по умолчанию" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="external_type_permission_values_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_2cb9e979a492a00d" unique="false">
            <column ascending="true" name="security_policy_rule_permission_all_values_id"/>
         </index>
      </table>
      <table name="integration" remarks="Таблица одобренных интаграций" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="uuid" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="2" name="name" nullable="true" remarks="" size="24" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="type" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="NULL::time without time zone" digits="0" id="4" name="create_time" nullable="true" remarks="" size="8" type="time" typeCode="92"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="integration_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="keycloak_domains" numRows="7" remarks="Таблица с данными конфига Keycloak" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="domain" nullable="false" remarks="Домен AmoEE (ключевое поле)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="verify_ssl" nullable="true" remarks="Значение ключа verify_ssl" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="3" name="base_url" nullable="true" remarks="Значение ключа base_url" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="4" name="realm" nullable="true" remarks="Значение ключа realm" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="5" name="client_id" nullable="true" remarks="Значение ключа client_id" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="6" name="client_secret" nullable="true" remarks="Значение ключа client_secret" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="7" name="redirect_uri" nullable="true" remarks="Значение ключа redirect_uri" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="8" name="encryption_algorithm" nullable="true" remarks="Значение ключа encryption_algorithm" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="9" name="encryption_key" nullable="true" remarks="Значение ключа encryption_key" size="512" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="10" name="encryption_key_path" nullable="true" remarks="Значение ключа encryption_key_path" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="11" name="version" nullable="true" remarks="Значение ключа version" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="12" name="service_client_id" nullable="true" remarks="client_id сервисного аккаунта Keycloak, обладающего правами manage-users/view-users" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="13" name="service_client_secret" nullable="true" remarks="client_secret сервисного аккаунта Keycloak, обладающего правами manage-users/view-users" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="keycloak_domains_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="uniq_9aee5e5ba7a91e0b" unique="true">
            <column ascending="true" name="domain"/>
         </index>
      </table>
      <table name="method" numRows="5" remarks="Таблица-справочник со всеми методами для запросов" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <child column="method_id" foreignKey="fk_47cc8c9219883967" implied="false" onDeleteCascade="false" schema="public" table="action"/>
            <child column="method_id" foreignKey="fk_action_api_method" implied="false" onDeleteCascade="false" schema="public" table="action_api"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="method" nullable="false" remarks="Название метода" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="method_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="role" numRows="15" remarks="Таблица ролей пользователей" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <child column="role_id" foreignKey="fk_cafe2b4bd60322ac" implied="false" onDeleteCascade="false" schema="public" table="custom_date_settings_rule"/>
            <child column="role_id" foreignKey="fk_ecea6d23d60322ac" implied="false" onDeleteCascade="false" schema="public" table="role_action"/>
            <child column="role_id" foreignKey="fk_8a3dfd1f45973bb9" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_value"/>
            <child column="role_id" foreignKey="fk_8d93d649d60322ac" implied="false" onDeleteCascade="false" schema="public" table="user"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="is_active" nullable="true" remarks="Значение активности/неактивности пользователя" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="name" nullable="true" remarks="Имя пользователя" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="account_id" nullable="true" remarks="Привязка к аккаунту" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_57698a6a9b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="account"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="order_num" nullable="true" remarks="Порядковый номер" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="amo_role_id" nullable="true" remarks="ID роли пользователя амо" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="6" name="is_default" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="role_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_57698a6a9b6b5fba" unique="false">
            <column ascending="true" name="account_id"/>
         </index>
      </table>
      <table name="role_action" numRows="16" remarks="Таблица связей ролей и запрещенных действий" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="role_id" nullable="false" remarks="Id роли, связь с таблицей role" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_ecea6d23d60322ac" implied="false" onDeleteCascade="false" schema="public" table="role"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="action_id" nullable="false" remarks="id активности, связь с таблицей action" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="role_action_action_id_fkey" implied="false" onDeleteCascade="false" schema="public" table="action"/>
         </column>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="role_action_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_ecea6d239d32f035" unique="false">
            <column ascending="true" name="action_id"/>
         </index>
         <index name="idx_ecea6d23d60322ac" unique="false">
            <column ascending="true" name="role_id"/>
         </index>
      </table>
      <table name="security_policy_category" numRows="7" remarks="Категории безопасности. Описывает категории для разных групп настроек." schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="Идентификатор категории" size="10" type="int4" typeCode="4">
            <child column="parent_category_id" foreignKey="fk_security_policy_category_parent" implied="false" onDeleteCascade="false" schema="public" table="security_policy_category"/>
            <child column="security_policy_category_id" foreignKey="fk_abb9031825c7de97" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="Название категории (например, &quot;Сделки&quot;, &quot;Контакты&quot;)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="order_num" nullable="true" remarks="Порядковый номер" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="''::character varying" digits="0" id="3" name="code" nullable="true" remarks="Внутренний постоянный код" size="255" type="varchar" typeCode="12">
            <parent column="code" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="amo_market_allowed_widgets"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="parent_category_id" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_security_policy_category_parent" implied="false" onDeleteCascade="false" schema="public" table="security_policy_category"/>
         </column>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_category_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_security_policy_category_parent" unique="false">
            <column ascending="true" name="parent_category_id"/>
         </index>
      </table>
      <table name="security_policy_edit_all_values" numRows="1594" remarks="Таблица связей разрешений и доступных для них значений разрешений для редактирования" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="Идентификатор связи" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="security_policy_rule_edit_all_values_id" nullable="false" remarks="Ссылка на значение разрешения для редактирования" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_9fa10841b8500ff" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_edit_all_values"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="security_policy_rule_permission_id" nullable="false" remarks="Ссылка на разрешение" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_9fa1084182b35c09" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_permission"/>
         </column>
         <column autoUpdated="false" defaultValue="false" digits="0" id="3" name="is_default" nullable="false" remarks="Флаг значения по умолчанию" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_edit_all_values_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_9fa1084182b35c09" unique="false">
            <column ascending="true" name="security_policy_rule_permission_id"/>
         </index>
         <index name="idx_9fa10841b8500ff" unique="false">
            <column ascending="true" name="security_policy_rule_edit_all_values_id"/>
         </index>
      </table>
      <table name="security_policy_element_types" numRows="7" remarks="" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <child column="security_policy_element_types_id" foreignKey="fk_sec_pol_elem_types_edit_dict_elem_type" implied="false" onDeleteCascade="false" schema="public" table="security_policy_element_types_edit_dictionary"/>
            <child column="security_policy_element_types_id" foreignKey="fk_sec_pol_elem_types_view_dict_elem_type" implied="false" onDeleteCascade="false" schema="public" table="security_policy_element_types_view_dictionary"/>
            <child column="element_type_id" foreignKey="fk_security_policy_rule_permission_element_type" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_permission"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="code" nullable="false" remarks="" size="50" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_element_types_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="element_type_code_unique" unique="true">
            <column ascending="true" name="code"/>
         </index>
      </table>
      <table name="security_policy_element_types_edit_dictionary" numRows="20" remarks="" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="security_policy_element_types_id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_sec_pol_elem_types_edit_dict_elem_type" implied="false" onDeleteCascade="false" schema="public" table="security_policy_element_types"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="security_policy_rule_edit_all_values_id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_sec_pol_elem_types_edit_dict_edit_value" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_edit_all_values"/>
         </column>
         <column autoUpdated="false" defaultValue="false" digits="0" id="3" name="is_default" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_element_types_edit_dictionary_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="element_type_edit_value_unique" unique="true">
            <column ascending="true" name="security_policy_element_types_id"/>
            <column ascending="true" name="security_policy_rule_edit_all_values_id"/>
         </index>
         <index name="idx_sec_pol_elem_types_edit_dict_edit_value" unique="false">
            <column ascending="true" name="security_policy_rule_edit_all_values_id"/>
         </index>
         <index name="idx_sec_pol_elem_types_edit_dict_elem_type" unique="false">
            <column ascending="true" name="security_policy_element_types_id"/>
         </index>
      </table>
      <table name="security_policy_element_types_view_dictionary" numRows="17" remarks="" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="security_policy_element_types_id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_sec_pol_elem_types_view_dict_elem_type" implied="false" onDeleteCascade="false" schema="public" table="security_policy_element_types"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="security_policy_rule_view_all_values_id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_sec_pol_elem_types_view_dict_view_value" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_view_all_values"/>
         </column>
         <column autoUpdated="false" defaultValue="false" digits="0" id="3" name="is_default" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_element_types_view_dictionary_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="element_type_view_value_unique" unique="true">
            <column ascending="true" name="security_policy_element_types_id"/>
            <column ascending="true" name="security_policy_rule_view_all_values_id"/>
         </index>
         <index name="idx_sec_pol_elem_types_view_dict_elem_type" unique="false">
            <column ascending="true" name="security_policy_element_types_id"/>
         </index>
         <index name="idx_sec_pol_elem_types_view_dict_view_value" unique="false">
            <column ascending="true" name="security_policy_rule_view_all_values_id"/>
         </index>
      </table>
      <table name="security_policy_rule" numRows="18" remarks="Правила безопасности. Справочник правил в рамках каждой категории." schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="Идентификатор правила" size="10" type="int4" typeCode="4">
            <child column="security_policy_rule_id" foreignKey="fk_6fe07143ede46fb8" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_permission"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="security_policy_category_id" nullable="false" remarks="Ссылка на категорию" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_abb9031825c7de97" implied="false" onDeleteCascade="false" schema="public" table="security_policy_category"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="name" nullable="false" remarks="Название правила (например, &quot;Поля&quot;, &quot;Фильтры&quot;)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="order_num" nullable="true" remarks="Порядковый номер" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="''::character varying" digits="0" id="4" name="code" nullable="true" remarks="Внутренний постоянный код" size="255" type="varchar" typeCode="12">
            <parent column="code" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="amo_market_allowed_widgets"/>
         </column>
         <column autoUpdated="false" defaultValue="'action_only'::character varying" digits="0" id="5" name="type" nullable="true" remarks="Тип категории (action_only, pipeline_action)" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_rule_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_abb9031825c7de97" unique="false">
            <column ascending="true" name="security_policy_category_id"/>
         </index>
      </table>
      <table name="security_policy_rule_edit_all_values" numRows="4" remarks="Каталог возможных значений разрешений для редактирования" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="Идентификатор значения разрешения" size="10" type="int4" typeCode="4">
            <child column="security_policy_rule_edit_all_values_id" foreignKey="fk_9fa10841b8500ff" implied="false" onDeleteCascade="false" schema="public" table="security_policy_edit_all_values"/>
            <child column="security_policy_rule_edit_all_values_id" foreignKey="fk_sec_pol_elem_types_edit_dict_edit_value" implied="false" onDeleteCascade="false" schema="public" table="security_policy_element_types_edit_dictionary"/>
            <child column="security_policy_rule_edit_all_values_id" foreignKey="fk_8a3dfd1fb8500ff" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_value"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="Название значения разрешения" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="description" nullable="false" remarks="Техническое описание" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="3" name="action_code" nullable="true" remarks="" size="100" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_rule_edit_all_values_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="security_policy_rule_permission" numRows="423" remarks="Разрешения для правил. Справочник значений разрешений для каждого правила." schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="Идентификатор разрешения" size="10" type="int4" typeCode="4">
            <child column="security_policy_rule_permission_id" foreignKey="fk_9fa1084182b35c09" implied="false" onDeleteCascade="false" schema="public" table="security_policy_edit_all_values"/>
            <child column="security_policy_rule_permission_id" foreignKey="fk_40f3fa1b82b35c09" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_permission_action"/>
            <child column="security_policy_rule_permission_id" foreignKey="fk_8a3dfd1f82b35c09" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_value"/>
            <child column="security_policy_rule_permission_id" foreignKey="fk_31ed578e82b35c09" implied="false" onDeleteCascade="false" schema="public" table="security_policy_view_all_values"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="security_policy_rule_id" nullable="false" remarks="Ссылка на правило" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_6fe07143ede46fb8" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="name" nullable="false" remarks="Название разрешения (например, &quot;Создание&quot;, &quot;Просмотр&quot;)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="order_num" nullable="true" remarks="Порядковый номер" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="account_id" nullable="true" remarks="Если не заполнено - общее правило для всех аккаунтов, заполнено - кастомная настройка" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_6fe071439b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="account"/>
         </column>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="5" name="external_id" nullable="true" remarks="Внешний идентификатор поля сущности в amoCRM для поиска по вёрстке или в API" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="6" name="external_type" nullable="true" remarks="Сущность и блок, в котором применяется правило (например: company_custom_field, company_sort_filter, table_setting)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="7" name="remove_algo" nullable="true" remarks="" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="8" name="code" nullable="true" remarks="" size="255" type="varchar" typeCode="12">
            <parent column="code" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="public" table="amo_market_allowed_widgets"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="element_type_id" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_security_policy_rule_permission_element_type" implied="false" onDeleteCascade="false" schema="public" table="security_policy_element_types"/>
         </column>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_rule_permission_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="account_external_type_idx" unique="false">
            <column ascending="true" name="account_id"/>
            <column ascending="true" name="external_type"/>
         </index>
         <index name="external_type_idx" unique="false">
            <column ascending="true" name="external_type"/>
         </index>
         <index name="idx_6fe071439b6b5fba" unique="false">
            <column ascending="true" name="account_id"/>
         </index>
         <index name="idx_6fe07143ede46fb8" unique="false">
            <column ascending="true" name="security_policy_rule_id"/>
         </index>
         <index name="idx_security_policy_rule_permission_element_type_id" unique="false">
            <column ascending="true" name="element_type_id"/>
         </index>
      </table>
      <table name="security_policy_rule_permission_action" remarks="Таблица связей разрешений и проверяемых на право доступа урлов" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="security_policy_rule_permission_id" nullable="false" remarks="Ссылка на разрешение" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_40f3fa1b82b35c09" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_permission"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="action_id" nullable="false" remarks="Ссылка на проверяемый на право доступа урл" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_40f3fa1b9d32f035" implied="false" onDeleteCascade="false" schema="public" table="action"/>
         </column>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_rule_permission_action_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_40f3fa1b82b35c09" unique="false">
            <column ascending="true" name="security_policy_rule_permission_id"/>
         </index>
         <index name="idx_40f3fa1b9d32f035" unique="false">
            <column ascending="true" name="action_id"/>
         </index>
      </table>
      <table name="security_policy_rule_value" numRows="730" remarks="Значения правил безопасности. Хранит применённые значения разрешений для каждого правила в зависимости от политики и статуса воронки." schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="Идентификатор значения" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="role_id" nullable="false" remarks="Ссылка на политику" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_8a3dfd1f45973bb9" implied="false" onDeleteCascade="false" schema="public" table="role"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="security_policy_rule_permission_id" nullable="false" remarks="Ссылка на разрешение (например, &quot;Разрешить&quot;)" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_8a3dfd1f82b35c09" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_permission"/>
         </column>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="3" name="view_pipeline_status" nullable="true" remarks="Список воронок_этапов с разделителем &quot;|&quot;, пример: &quot;8389622_68320162|8389622_68320166&quot;" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="security_policy_rule_view_all_values_id" nullable="true" remarks="Ссылка на значение разрешения для представления" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_security_policy_rule_value_view" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_view_all_values"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="edit_pipeline_status" nullable="true" remarks="Список воронок_этапов с разделителем &quot;|&quot;, пример: &quot;8389622_68320162|8389622_68320166&quot;" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="security_policy_rule_edit_all_values_id" nullable="true" remarks="Ссылка на значение разрешения для редактирования" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_8a3dfd1fb8500ff" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_edit_all_values"/>
         </column>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_rule_value_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_8a3dfd1f45973bb9" unique="false">
            <column ascending="true" name="role_id"/>
         </index>
         <index name="idx_8a3dfd1f82b35c09" unique="false">
            <column ascending="true" name="security_policy_rule_permission_id"/>
         </index>
         <index name="idx_8a3dfd1fa492a00d" unique="false">
            <column ascending="true" name="security_policy_rule_view_all_values_id"/>
         </index>
         <index name="idx_8a3dfd1fb8500ff" unique="false">
            <column ascending="true" name="security_policy_rule_edit_all_values_id"/>
         </index>
      </table>
      <table name="security_policy_rule_view_all_values" numRows="7" remarks="Каталог возможных значений разрешений для представления" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="Идентификатор значения разрешения" size="10" type="int4" typeCode="4">
            <child column="security_policy_rule_permission_all_values_id" foreignKey="fk_2cb9e979a492a00d" implied="false" onDeleteCascade="false" schema="public" table="external_type_permission_values"/>
            <child column="security_policy_rule_view_all_values_id" foreignKey="fk_sec_pol_elem_types_view_dict_view_value" implied="false" onDeleteCascade="false" schema="public" table="security_policy_element_types_view_dictionary"/>
            <child column="security_policy_rule_view_all_values_id" foreignKey="fk_security_policy_rule_value_view" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_value"/>
            <child column="security_policy_rule_view_all_values_id" foreignKey="fk_security_policy_view_all_values_view" implied="false" onDeleteCascade="false" schema="public" table="security_policy_view_all_values"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="Название значения разрешения" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="''::character varying" digits="0" id="2" name="description" nullable="false" remarks="Техническое описание" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="3" name="action_code" nullable="true" remarks="" size="100" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_rule_permission_all_values_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="security_policy_view_all_values" numRows="229" remarks="Таблица связей разрешений и доступных для них значений разрешений для представления" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="Идентификатор связи" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="security_policy_rule_view_all_values_id" nullable="false" remarks="Ссылка на значение разрешения для представления" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_security_policy_view_all_values_view" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_view_all_values"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="security_policy_rule_permission_id" nullable="false" remarks="Ссылка на разрешение" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_31ed578e82b35c09" implied="false" onDeleteCascade="false" schema="public" table="security_policy_rule_permission"/>
         </column>
         <column autoUpdated="false" defaultValue="false" digits="0" id="3" name="is_default" nullable="false" remarks="Флаг значения по умолчанию" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="security_policy_rule_all_values_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_31ed578e82b35c09" unique="false">
            <column ascending="true" name="security_policy_rule_permission_id"/>
         </index>
         <index name="idx_31ed578ea492a00d" unique="false">
            <column ascending="true" name="security_policy_rule_view_all_values_id"/>
         </index>
      </table>
      <table name="telephony_account" numRows="64" remarks="Таблица с аккаунтами телефонии" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <child column="telephony_account_id" foreignKey="fk_c47619eaf14c44b5" implied="false" onDeleteCascade="false" schema="public" table="telephony_user"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="account_id" nullable="false" remarks="Связь ст таблицей &quot;account&quot;" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_3a0a68a29b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="account"/>
         </column>
         <column autoUpdated="false" defaultValue="'sipuni'::character varying" digits="0" id="2" name="name" nullable="false" remarks="Название провайдера телефонии (sipuni, uis и т.д.)" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="'{}'::jsonb" digits="0" id="3" name="settings" nullable="false" remarks="JSON-настройки, специфичные для провайдера" size="2147483647" type="jsonb" typeCode="1111"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="telephony_account_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_telephony_account_account" unique="false">
            <column ascending="true" name="account_id"/>
         </index>
         <index name="idx_telephony_account_account_name" unique="false">
            <column ascending="true" name="account_id"/>
            <column ascending="true" name="name"/>
         </index>
         <index name="idx_telephony_account_name" unique="false">
            <column ascending="true" name="name"/>
         </index>
      </table>
      <table name="telephony_user" numRows="4" remarks="Таблица с пользователями телефонии" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="user_id" nullable="false" remarks="Связь с таблицей &quot;user&quot;" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_c47619eaa76ed395" implied="false" onDeleteCascade="false" schema="public" table="user"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="telephony_account_id" nullable="false" remarks="Связь с таблицей &quot;telephony_account&quot;" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_c47619eaf14c44b5" implied="false" onDeleteCascade="false" schema="public" table="telephony_account"/>
         </column>
         <column autoUpdated="false" defaultValue="NULL::character varying" digits="0" id="3" name="sip_number" nullable="true" remarks="SIP-телефон пользователя" size="255" type="varchar" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="telephony_user_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_c47619eaf14c44b5" unique="false">
            <column ascending="true" name="telephony_account_id"/>
         </index>
         <index name="idx_telephony_user_sip" unique="false">
            <column ascending="true" name="sip_number"/>
         </index>
         <index name="idx_telephony_user_user" unique="false">
            <column ascending="true" name="user_id"/>
         </index>
         <index name="uniq_telephony_user_user_account" unique="true">
            <column ascending="true" name="user_id"/>
            <column ascending="true" name="telephony_account_id"/>
         </index>
      </table>
      <table name="user" numRows="42" remarks="Таблица пользователей" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <child column="user_id" foreignKey="fk_c47619eaa76ed395" implied="false" onDeleteCascade="false" schema="public" table="telephony_user"/>
            <child column="user_id" foreignKey="user_session_user_id_fkey" implied="false" onDeleteCascade="true" schema="public" table="user_session"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="role_id" nullable="false" remarks="Id Роли, связь с таблицей role" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_8d93d649d60322ac" implied="false" onDeleteCascade="false" schema="public" table="role"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="account_id" nullable="false" remarks="id аккаунта, связь с таблицей account" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="fk_8d93d6499b6b5fba" implied="false" onDeleteCascade="false" schema="public" table="account"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="email" nullable="false" remarks="Почта пользователя" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="phone" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="access_token" nullable="true" remarks="Токен доступа пользователя" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="session_id" nullable="true" remarks="id сессии пользователя, нужен для авторизации" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="name" nullable="true" remarks="Имя пользователя" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="login" nullable="false" remarks="Логин пользователя" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="password" nullable="false" remarks="Пароль пользователя" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="refresh_token" nullable="true" remarks="Рефреш токен, нужен для авторизации" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="is_active" nullable="false" remarks="Параметр активности\неактивности пользователя" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="access_token_expires_at" nullable="true" remarks="Время истечения токена доступа пользователя" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="amocrm_id" nullable="true" remarks="Id пользователя в AmoCRM" size="10" type="int4" typeCode="4"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="user_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_8d93d6499b6b5fba" unique="false">
            <column ascending="true" name="account_id"/>
         </index>
         <index name="idx_8d93d649d60322ac" unique="false">
            <column ascending="true" name="role_id"/>
         </index>
      </table>
      <table name="user_session" numRows="700" remarks="Таблица с токенами кейклока (сессиями)" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="user_id" nullable="false" remarks="Связь с таблицей &quot;user&quot;" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="user_session_user_id_fkey" implied="false" onDeleteCascade="true" schema="public" table="user"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="keycloak_access_token" nullable="true" remarks="Access-токен от кейклока" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="keycloak_refresh_token" nullable="true" remarks="Refresh-токен от кейклока" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="keycloak_token_id" nullable="true" remarks="ID токена от кейклока, нужно для logout" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="created_at" nullable="false" remarks="Дата/время создания сессии" size="22" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="updated_at" nullable="true" remarks="Дата/время обновления сессии" size="22" type="timestamp" typeCode="93"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="user_session_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="user_session_keycloak_access_token_idx" unique="false">
            <column ascending="true" name="keycloak_access_token"/>
         </index>
         <index name="user_session_keycloak_refresh_token_idx" unique="false">
            <column ascending="true" name="keycloak_refresh_token"/>
         </index>
         <index name="user_session_user_id_idx" unique="false">
            <column ascending="true" name="user_id"/>
         </index>
      </table>
   </tables>
</database>
