1 line
157 KiB
Plaintext
1 line
157 KiB
Plaintext
{"errors": [{"message": "Ошибка при создании внешнего ключа fk_hlt_disp_card_rf_CitizenCategoryID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_citizencategory\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_disp_card\" \n ADD CONSTRAINT \"fk_hlt_disp_card_rf_CitizenCategoryID\" \n FOREIGN KEY (\"rf_CitizenCategoryID\") \n REFERENCES \"oms_citizencategory\" (\"CitizenCategoryID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T00:03:13.750908", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_citizencategory\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_citizencategory\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_disp_card\" \n ADD CONSTRAINT \"fk_hlt_disp_card_rf_CitizenCategoryID\" \n FOREIGN KEY (\"rf_CitizenCategoryID\") \n REFERENCES \"oms_citizencategory\" (\"CitizenCategoryID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_disp_card_rf_DogovorPatientID", "exception": "(psycopg2.errors.UndefinedTable) relation \"hlt_dogovorpatient\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_disp_card\" \n ADD CONSTRAINT \"fk_hlt_disp_card_rf_DogovorPatientID\" \n FOREIGN KEY (\"rf_DogovorPatientID\") \n REFERENCES \"hlt_dogovorpatient\" (\"DogovorPatientID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T00:03:13.752966", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"hlt_dogovorpatient\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"hlt_dogovorpatient\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_disp_card\" \n ADD CONSTRAINT \"fk_hlt_disp_card_rf_DogovorPatientID\" \n FOREIGN KEY (\"rf_DogovorPatientID\") \n REFERENCES \"hlt_dogovorpatient\" (\"DogovorPatientID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_disp_patientmodel_rf_kl_OrphanAgeGroupID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_orphanagegroup\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_disp_patientmodel\" \n ADD CONSTRAINT \"fk_hlt_disp_patientmodel_rf_kl_OrphanAgeGroupID\" \n FOREIGN KEY (\"rf_kl_OrphanAgeGroupID\") \n REFERENCES \"oms_kl_orphanagegroup\" (\"kl_OrphanAgeGroupID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T00:17:28.835112", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_orphanagegroup\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_orphanagegroup\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_disp_patientmodel\" \n ADD CONSTRAINT \"fk_hlt_disp_patientmodel_rf_kl_OrphanAgeGroupID\" \n FOREIGN KEY (\"rf_kl_OrphanAgeGroupID\") \n REFERENCES \"oms_kl_orphanagegroup\" (\"kl_OrphanAgeGroupID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_docprvd_rf_kl_SubComissionTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_subcomissiontype\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_docprvd\" \n ADD CONSTRAINT \"fk_hlt_docprvd_rf_kl_SubComissionTypeID\" \n FOREIGN KEY (\"rf_kl_SubComissionTypeID\") \n REFERENCES \"oms_kl_subcomissiontype\" (\"kl_SubComissionTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T00:18:04.153710", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_subcomissiontype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_subcomissiontype\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_docprvd\" \n ADD CONSTRAINT \"fk_hlt_docprvd_rf_kl_SubComissionTypeID\" \n FOREIGN KEY (\"rf_kl_SubComissionTypeID\") \n REFERENCES \"oms_kl_subcomissiontype\" (\"kl_SubComissionTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_docprvd_rf_KV_KATID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kv_kat\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_docprvd\" \n ADD CONSTRAINT \"fk_hlt_docprvd_rf_KV_KATID\" \n FOREIGN KEY (\"rf_KV_KATID\") \n REFERENCES \"oms_kv_kat\" (\"KV_KATID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T00:18:04.155836", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kv_kat\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kv_kat\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_docprvd\" \n ADD CONSTRAINT \"fk_hlt_docprvd_rf_KV_KATID\" \n FOREIGN KEY (\"rf_KV_KATID\") \n REFERENCES \"oms_kv_kat\" (\"KV_KATID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_invoice_rf_InvoiceTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"hlt_invoicetype\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_invoice\" \n ADD CONSTRAINT \"fk_hlt_invoice_rf_InvoiceTypeID\" \n FOREIGN KEY (\"rf_InvoiceTypeID\") \n REFERENCES \"hlt_invoicetype\" (\"InvoiceTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T00:18:40.611170", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"hlt_invoicetype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"hlt_invoicetype\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_invoice\" \n ADD CONSTRAINT \"fk_hlt_invoice_rf_InvoiceTypeID\" \n FOREIGN KEY (\"rf_InvoiceTypeID\") \n REFERENCES \"hlt_invoicetype\" (\"InvoiceTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_invoice_rf_PaymentTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"hlt_paymenttype\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_invoice\" \n ADD CONSTRAINT \"fk_hlt_invoice_rf_PaymentTypeID\" \n FOREIGN KEY (\"rf_PaymentTypeID\") \n REFERENCES \"hlt_paymenttype\" (\"PaymentTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T00:18:40.613150", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"hlt_paymenttype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"hlt_paymenttype\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_invoice\" \n ADD CONSTRAINT \"fk_hlt_invoice_rf_PaymentTypeID\" \n FOREIGN KEY (\"rf_PaymentTypeID\") \n REFERENCES \"hlt_paymenttype\" (\"PaymentTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_lpudoctor_rf_kl_SexID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_sex\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_lpudoctor\" \n ADD CONSTRAINT \"fk_hlt_lpudoctor_rf_kl_SexID\" \n FOREIGN KEY (\"rf_kl_SexID\") \n REFERENCES \"oms_kl_sex\" (\"kl_SexID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T00:18:44.900986", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_sex\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_sex\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_lpudoctor\" \n ADD CONSTRAINT \"fk_hlt_lpudoctor_rf_kl_SexID\" \n FOREIGN KEY (\"rf_kl_SexID\") \n REFERENCES \"oms_kl_sex\" (\"kl_SexID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_lpudoctor_rf_TypeDocID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_typedoc\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_lpudoctor\" \n ADD CONSTRAINT \"fk_hlt_lpudoctor_rf_TypeDocID\" \n FOREIGN KEY (\"rf_TypeDocID\") \n REFERENCES \"oms_typedoc\" (\"TYPEDOCID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T00:18:44.902873", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_typedoc\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_typedoc\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_lpudoctor\" \n ADD CONSTRAINT \"fk_hlt_lpudoctor_rf_TypeDocID\" \n FOREIGN KEY (\"rf_TypeDocID\") \n REFERENCES \"oms_typedoc\" (\"TYPEDOCID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_mkb_tap_rf_kl_DiagnosisCredibilityID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_diagnosiscredibility\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_mkb_tap\" \n ADD CONSTRAINT \"fk_hlt_mkb_tap_rf_kl_DiagnosisCredibilityID\" \n FOREIGN KEY (\"rf_kl_DiagnosisCredibilityID\") \n REFERENCES \"oms_kl_diagnosiscredibility\" (\"kl_DiagnosisCredibilityID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T01:04:58.681267", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_diagnosiscredibility\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_diagnosiscredibility\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_mkb_tap\" \n ADD CONSTRAINT \"fk_hlt_mkb_tap_rf_kl_DiagnosisCredibilityID\" \n FOREIGN KEY (\"rf_kl_DiagnosisCredibilityID\") \n REFERENCES \"oms_kl_diagnosiscredibility\" (\"kl_DiagnosisCredibilityID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_mkb_tap_rf_kl_DiagnosisValidityID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_diagnosisvalidity\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_mkb_tap\" \n ADD CONSTRAINT \"fk_hlt_mkb_tap_rf_kl_DiagnosisValidityID\" \n FOREIGN KEY (\"rf_kl_DiagnosisValidityID\") \n REFERENCES \"oms_kl_diagnosisvalidity\" (\"kl_DiagnosisValidityID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T01:04:58.683315", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_diagnosisvalidity\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_diagnosisvalidity\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_mkb_tap\" \n ADD CONSTRAINT \"fk_hlt_mkb_tap_rf_kl_DiagnosisValidityID\" \n FOREIGN KEY (\"rf_kl_DiagnosisValidityID\") \n REFERENCES \"oms_kl_diagnosisvalidity\" (\"kl_DiagnosisValidityID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при выполнении VACUUM ANALYZE для таблицы hlt_mkb_tap", "exception": "(psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"hlt_mkb_tap\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)", "timestamp": "2026-04-16T01:04:58.685529", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.ActiveSqlTransaction: VACUUM cannot run inside a transaction block\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 871, in vacuum_analyze_table\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.InternalError: (psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"hlt_mkb_tap\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)\n"}, {"message": "Ошибка при выполнении VACUUM ANALYZE для таблицы hlt_reestridcase", "exception": "(psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"hlt_reestridcase\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)", "timestamp": "2026-04-16T01:18:44.293369", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.ActiveSqlTransaction: VACUUM cannot run inside a transaction block\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 871, in vacuum_analyze_table\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.InternalError: (psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"hlt_reestridcase\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_regmedicalcheck_rf_kl_OncoSocialGroupID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_oncosocialgroup\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_regmedicalcheck\" \n ADD CONSTRAINT \"fk_hlt_regmedicalcheck_rf_kl_OncoSocialGroupID\" \n FOREIGN KEY (\"rf_kl_OncoSocialGroupID\") \n REFERENCES \"oms_kl_oncosocialgroup\" (\"kl_OncoSocialGroupID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T01:28:31.283306", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_oncosocialgroup\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_oncosocialgroup\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_regmedicalcheck\" \n ADD CONSTRAINT \"fk_hlt_regmedicalcheck_rf_kl_OncoSocialGroupID\" \n FOREIGN KEY (\"rf_kl_OncoSocialGroupID\") \n REFERENCES \"oms_kl_oncosocialgroup\" (\"kl_OncoSocialGroupID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании индекса idx_hlt_smtap_rf_omsservicemedicalid__smtapid__x_edition__x_status", "exception": "(psycopg2.errors.TooManyColumns) cannot use more than 32 columns in an index\n\n[SQL: CREATE INDEX IF NOT EXISTS \"idx_hlt_smtap_rf_omsservicemedicalid__smtapid__x_edition__x_status\" ON \"hlt_smtap\" (\"SMTAPID\", \"x_Edition\", \"x_Status\", \"rf_TAPID\", \"REG_S\", \"SMTAPGuid\", \"IsFake\", \"rf_LPUDoctorID\", \"Count\", \"DATE_P\", \"rf_DoctorVisitTableID\", \"FLAGS\", \"rf_LPUID\", \"rf_MKBID\", \"Description\", \"rf_TariffID\", \"rf_DepartmentID\", \"CreateUserName\", \"EditUserName\", \"FlagBill\", \"FlagComplete\", \"FlagPay\", \"FlagStatist\", \"rf_CreateUserID\", \"rf_EditUserID\", \"rf_InvoiceID\", \"rf_DocPRVDID\", \"Sum_Opl\", \"Sum_V\", \"DATE_E\", \"rf_kl_VisitPlaceID\", \"rf_LPUDoctor_SID\", \"rf_BillServiceID\", \"rf_RootSMTAPID\", \"rf_OperationID\", \"rf_kl_TeethID\", \"rf_kl_ActionTeethID\", \"rf_usl_ProfitTypeID\", \"rf_omsServiceMedicalID\")]\n(Background on this error at: https://sqlalche.me/e/20/e3q8)", "timestamp": "2026-04-16T02:00:34.922886", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.TooManyColumns: cannot use more than 32 columns in an index\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 710, in create_pg_indexes\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.OperationalError: (psycopg2.errors.TooManyColumns) cannot use more than 32 columns in an index\n\n[SQL: CREATE INDEX IF NOT EXISTS \"idx_hlt_smtap_rf_omsservicemedicalid__smtapid__x_edition__x_status\" ON \"hlt_smtap\" (\"SMTAPID\", \"x_Edition\", \"x_Status\", \"rf_TAPID\", \"REG_S\", \"SMTAPGuid\", \"IsFake\", \"rf_LPUDoctorID\", \"Count\", \"DATE_P\", \"rf_DoctorVisitTableID\", \"FLAGS\", \"rf_LPUID\", \"rf_MKBID\", \"Description\", \"rf_TariffID\", \"rf_DepartmentID\", \"CreateUserName\", \"EditUserName\", \"FlagBill\", \"FlagComplete\", \"FlagPay\", \"FlagStatist\", \"rf_CreateUserID\", \"rf_EditUserID\", \"rf_InvoiceID\", \"rf_DocPRVDID\", \"Sum_Opl\", \"Sum_V\", \"DATE_E\", \"rf_kl_VisitPlaceID\", \"rf_LPUDoctor_SID\", \"rf_BillServiceID\", \"rf_RootSMTAPID\", \"rf_OperationID\", \"rf_kl_TeethID\", \"rf_kl_ActionTeethID\", \"rf_usl_ProfitTypeID\", \"rf_omsServiceMedicalID\")]\n(Background on this error at: https://sqlalche.me/e/20/e3q8)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_smtap_rf_DogovorPayingID", "exception": "(psycopg2.errors.UndefinedTable) relation \"hlt_dogovorpaying\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_smtap\" \n ADD CONSTRAINT \"fk_hlt_smtap_rf_DogovorPayingID\" \n FOREIGN KEY (\"rf_DogovorPayingID\") \n REFERENCES \"hlt_dogovorpaying\" (\"DogovorPayingID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T02:00:41.569485", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"hlt_dogovorpaying\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"hlt_dogovorpaying\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_smtap\" \n ADD CONSTRAINT \"fk_hlt_smtap_rf_DogovorPayingID\" \n FOREIGN KEY (\"rf_DogovorPayingID\") \n REFERENCES \"hlt_dogovorpaying\" (\"DogovorPayingID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при выполнении VACUUM ANALYZE для таблицы hlt_smtap", "exception": "(psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"hlt_smtap\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)", "timestamp": "2026-04-16T02:00:41.571359", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.ActiveSqlTransaction: VACUUM cannot run inside a transaction block\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 871, in vacuum_analyze_table\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.InternalError: (psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"hlt_smtap\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_tap_rf_FomsRegMedicalCheckStatusID", "exception": "(psycopg2.errors.UndefinedTable) relation \"hlt_fomsregmedicalcheckstatus\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_tap\" \n ADD CONSTRAINT \"fk_hlt_tap_rf_FomsRegMedicalCheckStatusID\" \n FOREIGN KEY (\"rf_FomsRegMedicalCheckStatusID\") \n REFERENCES \"hlt_fomsregmedicalcheckstatus\" (\"FomsRegMedicalCheckStatusID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:24.249339", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"hlt_fomsregmedicalcheckstatus\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"hlt_fomsregmedicalcheckstatus\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_tap\" \n ADD CONSTRAINT \"fk_hlt_tap_rf_FomsRegMedicalCheckStatusID\" \n FOREIGN KEY (\"rf_FomsRegMedicalCheckStatusID\") \n REFERENCES \"hlt_fomsregmedicalcheckstatus\" (\"FomsRegMedicalCheckStatusID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_hlt_tap_rf_StatusGisOmsID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_statusgisoms\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_tap\" \n ADD CONSTRAINT \"fk_hlt_tap_rf_StatusGisOmsID\" \n FOREIGN KEY (\"rf_StatusGisOmsID\") \n REFERENCES \"oms_statusgisoms\" (\"StatusGisOmsID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:24.462757", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_statusgisoms\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_statusgisoms\" does not exist\n\n[SQL: \n ALTER TABLE \"hlt_tap\" \n ADD CONSTRAINT \"fk_hlt_tap_rf_StatusGisOmsID\" \n FOREIGN KEY (\"rf_StatusGisOmsID\") \n REFERENCES \"oms_statusgisoms\" (\"StatusGisOmsID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при выполнении VACUUM ANALYZE для таблицы hlt_tap", "exception": "(psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"hlt_tap\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)", "timestamp": "2026-04-16T03:10:24.464868", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.ActiveSqlTransaction: VACUUM cannot run inside a transaction block\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 871, in vacuum_analyze_table\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.InternalError: (psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"hlt_tap\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_AddressID", "exception": "(psycopg2.errors.UndefinedTable) relation \"kla_address\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_AddressID\" \n FOREIGN KEY (\"rf_AddressID\") \n REFERENCES \"kla_address\" (\"AddressID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.836713", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"kla_address\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"kla_address\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_AddressID\" \n FOREIGN KEY (\"rf_AddressID\") \n REFERENCES \"kla_address\" (\"AddressID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_kl_AgeGroupID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_agegroup\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_AgeGroupID\" \n FOREIGN KEY (\"rf_kl_AgeGroupID\") \n REFERENCES \"oms_kl_agegroup\" (\"kl_AgeGroupID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.838673", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_agegroup\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_agegroup\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_AgeGroupID\" \n FOREIGN KEY (\"rf_kl_AgeGroupID\") \n REFERENCES \"oms_kl_agegroup\" (\"kl_AgeGroupID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_kl_CategoryID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_category\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_CategoryID\" \n FOREIGN KEY (\"rf_kl_CategoryID\") \n REFERENCES \"oms_kl_category\" (\"kl_CategoryID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.840597", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_category\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_category\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_CategoryID\" \n FOREIGN KEY (\"rf_kl_CategoryID\") \n REFERENCES \"oms_kl_category\" (\"kl_CategoryID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_kl_LpuMedTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_lpumedtype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_LpuMedTypeID\" \n FOREIGN KEY (\"rf_kl_LpuMedTypeID\") \n REFERENCES \"oms_kl_lpumedtype\" (\"kl_LpuMedTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.842477", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_lpumedtype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_lpumedtype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_LpuMedTypeID\" \n FOREIGN KEY (\"rf_kl_LpuMedTypeID\") \n REFERENCES \"oms_kl_lpumedtype\" (\"kl_LpuMedTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_kl_MedCareTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_medcaretype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_MedCareTypeID\" \n FOREIGN KEY (\"rf_kl_MedCareTypeID\") \n REFERENCES \"oms_kl_medcaretype\" (\"kl_MedCareTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.844486", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_medcaretype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_medcaretype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_MedCareTypeID\" \n FOREIGN KEY (\"rf_kl_MedCareTypeID\") \n REFERENCES \"oms_kl_medcaretype\" (\"kl_MedCareTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_kl_TariffTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_tarifftype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_TariffTypeID\" \n FOREIGN KEY (\"rf_kl_TariffTypeID\") \n REFERENCES \"oms_kl_tarifftype\" (\"kl_TariffTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.846319", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_tarifftype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_tarifftype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_TariffTypeID\" \n FOREIGN KEY (\"rf_kl_TariffTypeID\") \n REFERENCES \"oms_kl_tarifftype\" (\"kl_TariffTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_kl_Type_LPUID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_type_lpu\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_Type_LPUID\" \n FOREIGN KEY (\"rf_kl_Type_LPUID\") \n REFERENCES \"oms_kl_type_lpu\" (\"kl_Type_LPUID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.848564", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_type_lpu\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_type_lpu\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_kl_Type_LPUID\" \n FOREIGN KEY (\"rf_kl_Type_LPUID\") \n REFERENCES \"oms_kl_type_lpu\" (\"kl_Type_LPUID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_OKATOID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_okato\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_OKATOID\" \n FOREIGN KEY (\"rf_OKATOID\") \n REFERENCES \"oms_okato\" (\"OKATOID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.855167", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_okato\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_okato\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_OKATOID\" \n FOREIGN KEY (\"rf_OKATOID\") \n REFERENCES \"oms_okato\" (\"OKATOID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_OrganisationID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_organisation\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_OrganisationID\" \n FOREIGN KEY (\"rf_OrganisationID\") \n REFERENCES \"oms_organisation\" (\"OrganisationID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.857247", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_organisation\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_organisation\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_OrganisationID\" \n FOREIGN KEY (\"rf_OrganisationID\") \n REFERENCES \"oms_organisation\" (\"OrganisationID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_lpu_rf_TariffTargetID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_tarifftarget\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_TariffTargetID\" \n FOREIGN KEY (\"rf_TariffTargetID\") \n REFERENCES \"oms_tarifftarget\" (\"TariffTargetID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T03:10:42.865005", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_tarifftarget\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_tarifftarget\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_lpu\" \n ADD CONSTRAINT \"fk_oms_lpu_rf_TariffTargetID\" \n FOREIGN KEY (\"rf_TariffTargetID\") \n REFERENCES \"oms_tarifftarget\" (\"TariffTargetID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании индекса idx_oms_paramvalue_idx_pramavalue_datevaluerf_paramid", "exception": "(psycopg2.errors.ProgramLimitExceeded) index row requires 10128 bytes, maximum size is 8191\nCONTEXT: parallel worker\n\n[SQL: CREATE INDEX IF NOT EXISTS \"idx_oms_paramvalue_idx_pramavalue_datevaluerf_paramid\" ON \"oms_paramvalue\" (\"Date\", \"Value\", \"rf_ParamID\", \"PatientGUID\")]\n(Background on this error at: https://sqlalche.me/e/20/e3q8)", "timestamp": "2026-04-16T07:51:25.356176", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.ProgramLimitExceeded: index row requires 10128 bytes, maximum size is 8191\nCONTEXT: parallel worker\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 710, in create_pg_indexes\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.OperationalError: (psycopg2.errors.ProgramLimitExceeded) index row requires 10128 bytes, maximum size is 8191\nCONTEXT: parallel worker\n\n[SQL: CREATE INDEX IF NOT EXISTS \"idx_oms_paramvalue_idx_pramavalue_datevaluerf_paramid\" ON \"oms_paramvalue\" (\"Date\", \"Value\", \"rf_ParamID\", \"PatientGUID\")]\n(Background on this error at: https://sqlalche.me/e/20/e3q8)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_paramvalue_rf_mn_DocLPUID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_mn_doclpu\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_paramvalue\" \n ADD CONSTRAINT \"fk_oms_paramvalue_rf_mn_DocLPUID\" \n FOREIGN KEY (\"rf_mn_DocLPUID\") \n REFERENCES \"oms_mn_doclpu\" (\"mn_DocLPUID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:52:14.115262", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_mn_doclpu\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_mn_doclpu\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_paramvalue\" \n ADD CONSTRAINT \"fk_oms_paramvalue_rf_mn_DocLPUID\" \n FOREIGN KEY (\"rf_mn_DocLPUID\") \n REFERENCES \"oms_mn_doclpu\" (\"mn_DocLPUID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_paramvalue_rf_mn_PersonID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_mn_person\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_paramvalue\" \n ADD CONSTRAINT \"fk_oms_paramvalue_rf_mn_PersonID\" \n FOREIGN KEY (\"rf_mn_PersonID\") \n REFERENCES \"oms_mn_person\" (\"mn_PersonID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:52:14.117917", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_mn_person\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_mn_person\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_paramvalue\" \n ADD CONSTRAINT \"fk_oms_paramvalue_rf_mn_PersonID\" \n FOREIGN KEY (\"rf_mn_PersonID\") \n REFERENCES \"oms_mn_person\" (\"mn_PersonID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_paramvalue_rf_ParamID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_param\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_paramvalue\" \n ADD CONSTRAINT \"fk_oms_paramvalue_rf_ParamID\" \n FOREIGN KEY (\"rf_ParamID\") \n REFERENCES \"oms_param\" (\"ParamID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:52:14.121537", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_param\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_param\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_paramvalue\" \n ADD CONSTRAINT \"fk_oms_paramvalue_rf_ParamID\" \n FOREIGN KEY (\"rf_ParamID\") \n REFERENCES \"oms_param\" (\"ParamID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_paramvalue_rf_ParamVarID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_paramvar\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_paramvalue\" \n ADD CONSTRAINT \"fk_oms_paramvalue_rf_ParamVarID\" \n FOREIGN KEY (\"rf_ParamVarID\") \n REFERENCES \"oms_paramvar\" (\"ParamVarID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:52:14.123917", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_paramvar\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_paramvar\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_paramvalue\" \n ADD CONSTRAINT \"fk_oms_paramvalue_rf_ParamVarID\" \n FOREIGN KEY (\"rf_ParamVarID\") \n REFERENCES \"oms_paramvar\" (\"ParamVarID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при выполнении VACUUM ANALYZE для таблицы oms_paramvalue", "exception": "(psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"oms_paramvalue\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)", "timestamp": "2026-04-16T07:52:14.126357", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.ActiveSqlTransaction: VACUUM cannot run inside a transaction block\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 871, in vacuum_analyze_table\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.InternalError: (psycopg2.errors.ActiveSqlTransaction) VACUUM cannot run inside a transaction block\n\n[SQL: VACUUM ANALYZE \"oms_paramvalue\"]\n(Background on this error at: https://sqlalche.me/e/20/2j85)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_prvd_rf_kl_ProfitTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_profittype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_prvd\" \n ADD CONSTRAINT \"fk_oms_prvd_rf_kl_ProfitTypeID\" \n FOREIGN KEY (\"rf_kl_ProfitTypeID\") \n REFERENCES \"oms_kl_profittype\" (\"kl_ProfitTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:52:18.716558", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_profittype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_profittype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_prvd\" \n ADD CONSTRAINT \"fk_oms_prvd_rf_kl_ProfitTypeID\" \n FOREIGN KEY (\"rf_kl_ProfitTypeID\") \n REFERENCES \"oms_kl_profittype\" (\"kl_ProfitTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_ActionTeethID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_actionteeth\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_ActionTeethID\" \n FOREIGN KEY (\"rf_kl_ActionTeethID\") \n REFERENCES \"oms_kl_actionteeth\" (\"kl_ActionTeethID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.891610", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_actionteeth\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_actionteeth\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_ActionTeethID\" \n FOREIGN KEY (\"rf_kl_ActionTeethID\") \n REFERENCES \"oms_kl_actionteeth\" (\"kl_ActionTeethID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_AgeGroupID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_agegroup\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_AgeGroupID\" \n FOREIGN KEY (\"rf_kl_AgeGroupID\") \n REFERENCES \"oms_kl_agegroup\" (\"kl_AgeGroupID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.893773", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_agegroup\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_agegroup\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_AgeGroupID\" \n FOREIGN KEY (\"rf_kl_AgeGroupID\") \n REFERENCES \"oms_kl_agegroup\" (\"kl_AgeGroupID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_DepartmentProfileID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_departmentprofile\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_DepartmentProfileID\" \n FOREIGN KEY (\"rf_kl_DepartmentProfileID\") \n REFERENCES \"oms_kl_departmentprofile\" (\"kl_DepartmentProfileID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.909094", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_departmentprofile\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_departmentprofile\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_DepartmentProfileID\" \n FOREIGN KEY (\"rf_kl_DepartmentProfileID\") \n REFERENCES \"oms_kl_departmentprofile\" (\"kl_DepartmentProfileID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_DepartmentTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_departmenttype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_DepartmentTypeID\" \n FOREIGN KEY (\"rf_kl_DepartmentTypeID\") \n REFERENCES \"oms_kl_departmenttype\" (\"kl_DepartmentTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.911260", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_departmenttype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_departmenttype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_DepartmentTypeID\" \n FOREIGN KEY (\"rf_kl_DepartmentTypeID\") \n REFERENCES \"oms_kl_departmenttype\" (\"kl_DepartmentTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_MedCareLicenceID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_medcarelicence\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_MedCareLicenceID\" \n FOREIGN KEY (\"rf_kl_MedCareLicenceID\") \n REFERENCES \"oms_kl_medcarelicence\" (\"kl_MedCareLicenceID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.913090", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_medcarelicence\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_medcarelicence\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_MedCareLicenceID\" \n FOREIGN KEY (\"rf_kl_MedCareLicenceID\") \n REFERENCES \"oms_kl_medcarelicence\" (\"kl_MedCareLicenceID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_MedCareTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_medcaretype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_MedCareTypeID\" \n FOREIGN KEY (\"rf_kl_MedCareTypeID\") \n REFERENCES \"oms_kl_medcaretype\" (\"kl_MedCareTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.914992", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_medcaretype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_medcaretype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_MedCareTypeID\" \n FOREIGN KEY (\"rf_kl_MedCareTypeID\") \n REFERENCES \"oms_kl_medcaretype\" (\"kl_MedCareTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_MedCareUnitID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_medcareunit\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_MedCareUnitID\" \n FOREIGN KEY (\"rf_kl_MedCareUnitID\") \n REFERENCES \"oms_kl_medcareunit\" (\"kl_MedCareUnitID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.916851", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_medcareunit\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_medcareunit\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_MedCareUnitID\" \n FOREIGN KEY (\"rf_kl_MedCareUnitID\") \n REFERENCES \"oms_kl_medcareunit\" (\"kl_MedCareUnitID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_MetodHMPID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_metodhmp\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_MetodHMPID\" \n FOREIGN KEY (\"rf_kl_MetodHMPID\") \n REFERENCES \"oms_kl_metodhmp\" (\"kl_MetodHMPID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.918876", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_metodhmp\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_metodhmp\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_MetodHMPID\" \n FOREIGN KEY (\"rf_kl_MetodHMPID\") \n REFERENCES \"oms_kl_metodhmp\" (\"kl_MetodHMPID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_NomServiceID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_nomservice\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_NomServiceID\" \n FOREIGN KEY (\"rf_kl_NomServiceID\") \n REFERENCES \"oms_kl_nomservice\" (\"kl_NomServiceID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.920623", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_nomservice\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_nomservice\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_NomServiceID\" \n FOREIGN KEY (\"rf_kl_NomServiceID\") \n REFERENCES \"oms_kl_nomservice\" (\"kl_NomServiceID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_OperationTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_operationtype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_OperationTypeID\" \n FOREIGN KEY (\"rf_kl_OperationTypeID\") \n REFERENCES \"oms_kl_operationtype\" (\"kl_OperationTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.922569", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_operationtype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_operationtype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_OperationTypeID\" \n FOREIGN KEY (\"rf_kl_OperationTypeID\") \n REFERENCES \"oms_kl_operationtype\" (\"kl_OperationTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_ProfitTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_profittype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_ProfitTypeID\" \n FOREIGN KEY (\"rf_kl_ProfitTypeID\") \n REFERENCES \"oms_kl_profittype\" (\"kl_ProfitTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.924434", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_profittype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_profittype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_ProfitTypeID\" \n FOREIGN KEY (\"rf_kl_ProfitTypeID\") \n REFERENCES \"oms_kl_profittype\" (\"kl_ProfitTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_SexID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_sex\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_SexID\" \n FOREIGN KEY (\"rf_kl_SexID\") \n REFERENCES \"oms_kl_sex\" (\"kl_SexID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.926144", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_sex\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_sex\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_SexID\" \n FOREIGN KEY (\"rf_kl_SexID\") \n REFERENCES \"oms_kl_sex\" (\"kl_SexID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_kl_VisitTypeID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_kl_visittype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_VisitTypeID\" \n FOREIGN KEY (\"rf_kl_VisitTypeID\") \n REFERENCES \"oms_kl_visittype\" (\"kl_VisitTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.927896", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_kl_visittype\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_kl_visittype\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_kl_VisitTypeID\" \n FOREIGN KEY (\"rf_kl_VisitTypeID\") \n REFERENCES \"oms_kl_visittype\" (\"kl_VisitTypeID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_PRVSID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_prvs\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_PRVSID\" \n FOREIGN KEY (\"rf_PRVSID\") \n REFERENCES \"oms_prvs\" (\"PRVSID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.938385", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_prvs\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_prvs\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_PRVSID\" \n FOREIGN KEY (\"rf_PRVSID\") \n REFERENCES \"oms_prvs\" (\"PRVSID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании внешнего ключа fk_oms_servicemedical_rf_sc_StandartCureID", "exception": "(psycopg2.errors.UndefinedTable) relation \"oms_sc_standartcure\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_sc_StandartCureID\" \n FOREIGN KEY (\"rf_sc_StandartCureID\") \n REFERENCES \"oms_sc_standartcure\" (\"sc_StandartCureID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)", "timestamp": "2026-04-16T07:53:01.940286", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.UndefinedTable: relation \"oms_sc_standartcure\" does not exist\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 843, in create_pg_foreign_keys\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation \"oms_sc_standartcure\" does not exist\n\n[SQL: \n ALTER TABLE \"oms_servicemedical\" \n ADD CONSTRAINT \"fk_oms_servicemedical_rf_sc_StandartCureID\" \n FOREIGN KEY (\"rf_sc_StandartCureID\") \n REFERENCES \"oms_sc_standartcure\" (\"sc_StandartCureID\")\n ]\n(Background on this error at: https://sqlalche.me/e/20/f405)\n"}, {"message": "Ошибка при создании индекса idx_stt_diagnos_ix_rf_migrationpatientid_rf_diagnostypeid", "exception": "(psycopg2.errors.ProgramLimitExceeded) index row size 2832 exceeds btree version 4 maximum 2704 for index \"idx_stt_diagnos_ix_rf_migrationpatientid_rf_diagnostypeid\"\nDETAIL: Index row references tuple (27367,11) in relation \"stt_diagnos\".\nHINT: Values larger than 1/3 of a buffer page cannot be indexed.\nConsider a function index of an MD5 hash of the value, or use full text indexing.\n\n[SQL: CREATE INDEX IF NOT EXISTS \"idx_stt_diagnos_ix_rf_migrationpatientid_rf_diagnostypeid\" ON \"stt_diagnos\" (\"rf_MKBID\", \"Description\", \"DiagnosID\", \"rf_MigrationPatientID\", \"rf_DiagnosTypeID\", \"Date\")]\n(Background on this error at: https://sqlalche.me/e/20/e3q8)", "timestamp": "2026-04-16T08:02:13.317979", "traceback": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\npsycopg2.errors.ProgramLimitExceeded: index row size 2832 exceeds btree version 4 maximum 2704 for index \"idx_stt_diagnos_ix_rf_migrationpatientid_rf_diagnostypeid\"\nDETAIL: Index row references tuple (27367,11) in relation \"stt_diagnos\".\nHINT: Values larger than 1/3 of a buffer page cannot be indexed.\nConsider a function index of an MD5 hash of the value, or use full text indexing.\n\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/app/app/migrator.py\", line 710, in create_pg_indexes\n conn.execute(text(sql))\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1419, in execute\n return meth(\n ^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/sql/elements.py\", line 527, in _execute_on_connection\n return connection._execute_clauseelement(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1641, in _execute_clauseelement\n ret = self._execute_context(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1846, in _execute_context\n return self._exec_single_context(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1986, in _exec_single_context\n self._handle_dbapi_exception(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 2363, in _handle_dbapi_exception\n raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/base.py\", line 1967, in _exec_single_context\n self.dialect.do_execute(\n File \"/usr/local/lib/python3.12/site-packages/sqlalchemy/engine/default.py\", line 952, in do_execute\n cursor.execute(statement, parameters)\nsqlalchemy.exc.OperationalError: (psycopg2.errors.ProgramLimitExceeded) index row size 2832 exceeds btree version 4 maximum 2704 for index \"idx_stt_diagnos_ix_rf_migrationpatientid_rf_diagnostypeid\"\nDETAIL: Index row references tuple (27367,11) in relation \"stt_diagnos\".\nHINT: Values larger than 1/3 of a buffer page cannot be indexed.\nConsider a function index of an MD5 hash of the value, or use full text indexing.\n\n[SQL: CREATE INDEX IF NOT EXISTS \"idx_stt_diagnos_ix_rf_migrationpatientid_rf_diagnostypeid\" ON \"stt_diagnos\" (\"rf_MKBID\", \"Description\", \"DiagnosID\", \"rf_MigrationPatientID\", \"rf_DiagnosTypeID\", \"Date\")]\n(Background on this error at: https://sqlalche.me/e/20/e3q8)\n"}], "summary": {"duration": "8:47:38.222537", "end_time": "2026-04-16T08:47:39.407498", "start_time": "2026-04-16T00:00:01.184961", "total_rows": 40198631, "success_rate": 98.0, "total_tables": 50, "failed_tables": 1, "successful_tables": 49}, "failed_tables": [{"name": "hlt_MKAB", "error": "(pymssql.exceptions.OperationalError) (20047, b'DB-Lib error message 20047, severity 9:\\nDBPROCESS is dead or not enabled\\n')\n(Background on this error at: https://sqlalche.me/e/20/e3q8)"}], "successful_tables": [{"name": "die_Card", "rows": 8553}, {"name": "die_Certificate", "rows": 11536}, {"name": "die_Mkb", "rows": 46358}, {"name": "hlt_BillService", "rows": 9858}, {"name": "hlt_dent_tech_OrderSM", "rows": 1}, {"name": "hlt_disp_Card", "rows": 42030}, {"name": "hlt_disp_CardPlan", "rows": 783}, {"name": "hlt_disp_Exam", "rows": 912329}, {"name": "hlt_disp_PatientModel", "rows": 3283}, {"name": "hlt_disp_ServicePM", "rows": 62714}, {"name": "hlt_disp_Type", "rows": 23}, {"name": "hlt_DocPRVD", "rows": 3608}, {"name": "hlt_DUVisit", "rows": 77127}, {"name": "hlt_Invoice", "rows": 9691}, {"name": "hlt_LPUDoctor", "rows": 2154}, {"name": "hlt_MKB_TAP", "rows": 1391150}, {"name": "hlt_PolisMKAB", "rows": 527789}, {"name": "hlt_ReestrIdCase", "rows": 1878134}, {"name": "hlt_ReestrMH", "rows": 182}, {"name": "hlt_ReestrMHSMTAP", "rows": 610236}, {"name": "hlt_ReestrTAPMH", "rows": 372890}, {"name": "hlt_RegMedicalCheck", "rows": 49962}, {"name": "hlt_SMTAP", "rows": 1534142}, {"name": "hlt_TAP", "rows": 1727450}, {"name": "oms_DocumentStatus", "rows": 4}, {"name": "oms_kl_DDService", "rows": 17}, {"name": "Oms_LPU", "rows": 2610}, {"name": "Oms_mkb", "rows": 16418}, {"name": "oms_ParamValue", "rows": 28229554}, {"name": "Oms_PRVD", "rows": 329}, {"name": "oms_ServiceMedical", "rows": 19846}, {"name": "oms_StateBirth", "rows": 5}, {"name": "smp_MedService", "rows": 1007}, {"name": "stt_Bed", "rows": 1584}, {"name": "stt_BedAction", "rows": 69516}, {"name": "stt_Dead", "rows": 1479}, {"name": "stt_Diagnos", "rows": 918098}, {"name": "stt_EmerSign", "rows": 4}, {"name": "stt_MedicalHistory", "rows": 241760}, {"name": "stt_MedServicePatient", "rows": 258671}, {"name": "stt_MigrationPatient", "rows": 869917}, {"name": "stt_NewbornHistory", "rows": 6616}, {"name": "stt_OperationPurpose", "rows": 76091}, {"name": "stt_ProcedureList", "rows": 58}, {"name": "stt_Reanimation", "rows": 12408}, {"name": "stt_ReestrMKSB", "rows": 90102}, {"name": "stt_ReestrOccasion", "rows": 39859}, {"name": "stt_StationarBranch", "rows": 139}, {"name": "stt_SurgicalOperation", "rows": 60556}]} |