An ActiveRecord::InvalidForeignKey occurred in gateways#destroy
An ActiveRecord::InvalidForeignKey occurred in gateways#destroy:
PG::ForeignKeyViolation: ERROR: update or delete on table "gateway_ui_node_log_uploads" violates foreign key constraint "ui_node_logs_gateway_ui_node_log_upload_id_fkey" on table "ui_node_logs"
DETAIL: Key (id)=(1972021) is still referenced from table "ui_node_logs".
: DELETE FROM "gateway_ui_node_log_uploads" WHERE "gateway_ui_node_log_uploads"."id" = $1
app/controllers/gateways_controller.rb:38:in `destroy'
-------------------------------
Request:
-------------------------------
* URL : https://www.bikelink.org/gateways/168
* HTTP Method: DELETE
* IP address : 46.227.11.68
* Parameters : {"_method"=>"delete", "authenticity_token"=>"T80ooQmLcGfo2CXviLQKz/QYUCDRNTM6PeVlgDfTlUik4suIMXa4WM/W9/8lf1QaCaa8vxWqB/bvwtzTFd4b1g==", "controller"=>"gateways", "action"=>"destroy", "id"=>"168"}
* Timestamp : 2021-04-14 18:43:28 UTC
* Server : www-3.internal.bikelink.org
* Rails root : /var/www/bikelink
* Process: 14015
-------------------------------
Session:
-------------------------------
* session id: [FILTERED]
* data: {"session_id"=>"d0005221a9bd4ddfd24e9b9f3ed00e2a",
"warden.user.person.key"=>[[3142], "UqiUAY8xyiftXkpAfojn"],
"_csrf_token"=>"B9Cgw3gjfeEb7o+WevstwKvPxKBluh+OWR/gVTkpcv4="}
-------------------------------
Backtrace:
-------------------------------
app/controllers/gateways_controller.rb:38:in `destroy'
Znovu načíst